Skip to content

Commit 5299023

Browse files
committed
pubsub: remove redundant sends of hello packet
1 parent d6d84ae commit 5299023

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pubsub.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,8 @@ func (p *PubSub) handlePendingPeers() {
919919
}
920920

921921
rpcQueue := newRpcQueue(p.peerOutboundQueueSize)
922-
rpcQueue.Push(p.getHelloPacket(), true)
923-
go p.handleNewPeer(p.ctx, pid, rpcQueue)
924922
p.peers[pid] = rpcQueue
923+
go p.handleNewPeer(p.ctx, pid, rpcQueue)
925924
}
926925
}
927926

@@ -966,7 +965,6 @@ func (p *PubSub) handleDeadPeers() {
966965
// we respawn the writer as we need to ensure there is a stream active
967966
log.Debugf("peer declared dead but still connected; respawning writer: %s", pid)
968967
rpcQueue := newRpcQueue(p.peerOutboundQueueSize)
969-
rpcQueue.Push(p.getHelloPacket(), true)
970968
p.peers[pid] = rpcQueue
971969
go p.handleNewPeerWithBackoff(p.ctx, pid, backoffDelay, rpcQueue)
972970
}

0 commit comments

Comments
 (0)