Skip to content

Commit 85fa407

Browse files
committed
pubsub: remove redundant sends of hello packet
1 parent 7e8e2cc commit 85fa407

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
@@ -944,9 +944,8 @@ func (p *PubSub) handlePendingPeers() {
944944
}
945945

946946
rpcQueue := newRpcQueue(p.peerOutboundQueueSize)
947-
rpcQueue.Push(p.getHelloPacket(), true)
948-
go p.handleNewPeer(p.ctx, pid, rpcQueue)
949947
p.peers[pid] = rpcQueue
948+
go p.handleNewPeer(p.ctx, pid, rpcQueue)
950949
}
951950
}
952951

@@ -991,7 +990,6 @@ func (p *PubSub) handleDeadPeers() {
991990
// we respawn the writer as we need to ensure there is a stream active
992991
p.logger.Debug("peer declared dead but still connected; respawning writer", "peer", pid)
993992
rpcQueue := newRpcQueue(p.peerOutboundQueueSize)
994-
rpcQueue.Push(p.getHelloPacket(), true)
995993
p.peers[pid] = rpcQueue
996994
go p.handleNewPeerWithBackoff(p.ctx, pid, backoffDelay, rpcQueue)
997995
}

0 commit comments

Comments
 (0)