mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 20:37:17 +00:00
Only one handshake at a time with active peers (#4519)
This commit is contained in:
parent
a8edfa42cc
commit
44fa2c6371
@ -22,8 +22,8 @@ func (s *Service) AddConnectionHandler(reqFunc func(ctx context.Context, id peer
|
||||
|
||||
// Handle the various pre-existing conditions that will result in us not handshaking.
|
||||
peerConnectionState, err := s.peers.ConnectionState(conn.RemotePeer())
|
||||
if err == nil && peerConnectionState == peers.PeerConnected {
|
||||
log.Debug("Peer already connected; not handshaking again")
|
||||
if err == nil && (peerConnectionState == peers.PeerConnected || peerConnectionState == peers.PeerConnecting) {
|
||||
log.WithField("currentState", peerConnectionState).Debug("Peer already active; not handshaking again")
|
||||
return
|
||||
}
|
||||
s.peers.Add(conn.RemotePeer(), conn.RemoteMultiaddr(), conn.Stat().Direction)
|
||||
|
Loading…
Reference in New Issue
Block a user