Skip to content

Commit

Permalink
avoid sending empty Iwant messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkingsugar committed Apr 27, 2021
1 parent 06701f4 commit 77158bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libp2p/protocols/pubsub/gossipsub.nim
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ proc handleControl(g: GossipSub, peer: PubSubPeer, rpcMsg: RPCMsg) =
g.handlePrune(peer, control.prune)

var respControl: ControlMessage
respControl.iwant.add(g.handleIHave(peer, control.ihave))
let iwant = g.handleIHave(peer, control.ihave)
if iwant.messageIDs.len > 0:
respControl.iwant.add(iwant)
respControl.prune.add(g.handleGraft(peer, control.graft))
let messages = g.handleIWant(peer, control.iwant)

Expand Down

0 comments on commit 77158bb

Please sign in to comment.