separate reinstatement of peers from discovery of new peers

This commit is contained in:
Callum Michael Waters
2020-03-10 19:04:45 +01:00
parent 6ccd3324c2
commit e18636ef1f

View File

@@ -494,8 +494,12 @@ func (r *Reactor) ensurePeers() {
}
if r.book.NeedMoreAddrs() {
// 0) Check if banned nodes can be reinstated
// Check if banned nodes can be reinstated
r.book.ReinstateBadPeers()
}
if r.book.NeedMoreAddrs() {
// 1) Pick a random peer and ask for more.
peers := r.Switch.Peers().List()
peersCount := len(peers)