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
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue