mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
server: request new peer after disconnection of non-persistent peers
Doing so ensures we reach our target number of outbound peers as soon as possible. This is only necessary after calls to connmgr.Remove, as these won't request a new peer connection.
This commit is contained in:
parent
45d66d46f9
commit
0d00cdf82c
@ -1680,6 +1680,7 @@ func (s *server) handleDonePeerMsg(state *peerState, sp *serverPeer) {
|
||||
s.connManager.Disconnect(sp.connReq.ID())
|
||||
} else {
|
||||
s.connManager.Remove(sp.connReq.ID())
|
||||
go s.connManager.NewConnReq()
|
||||
}
|
||||
}
|
||||
|
||||
@ -2031,6 +2032,7 @@ func (s *server) outboundPeerConnected(c *connmgr.ConnReq, conn net.Conn) {
|
||||
s.connManager.Disconnect(c.ID())
|
||||
} else {
|
||||
s.connManager.Remove(c.ID())
|
||||
go s.connManager.NewConnReq()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user