Skip to content

Commit

Permalink
rename var
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Nov 26, 2024
1 parent 7f131d5 commit 66013d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bitswap/client/internal/messagequeue/messagequeue.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,17 +490,17 @@ func (mq *MessageQueue) runQueue() {
}

// Periodically resend the list of wants to the peer
func (mq *MessageQueue) rebroadcastWantlist(doNow bool) {
func (mq *MessageQueue) rebroadcastWantlist(immediate bool) {
// If some wants were transferred from the rebroadcast list
if toRebroadcast := mq.transferRebroadcastWants(doNow); toRebroadcast > 0 {
if toRebroadcast := mq.transferRebroadcastWants(immediate); toRebroadcast > 0 {
// Send them out
mq.sendMessage()
log.Infow("Rebroadcasting wants", "amount", toRebroadcast, "peer", mq.p)
}
}

// Transfer wants from the rebroadcast lists into the pending lists.
func (mq *MessageQueue) transferRebroadcastWants(doNow bool) int {
func (mq *MessageQueue) transferRebroadcastWants(immediate bool) int {
mq.wllock.Lock()
defer mq.wllock.Unlock()

Expand All @@ -509,7 +509,7 @@ func (mq *MessageQueue) transferRebroadcastWants(doNow bool) int {
}

interval := rebroadcastInterval
if doNow {
if immediate {
interval = 0
}
now := mq.clock.Now()
Expand Down

0 comments on commit 66013d7

Please sign in to comment.