don't spin forever looking for peers (#724)

This commit is contained in:
jadeblaquiere 2016-08-20 23:11:12 -04:00 committed by Dave Collins
parent 7c4b169faa
commit 47ced81d44

View file

@ -1826,12 +1826,6 @@ out:
break
}
// Check that we don't have a pending connection to this addr.
addrStr := addrmgr.NetAddressKey(addr.NetAddress())
if _, ok := state.pendingPeers[addrStr]; ok {
continue
}
tries++
// After 100 bad tries exit the loop and we'll try again
// later.
@ -1839,6 +1833,12 @@ out:
break
}
// Check that we don't have a pending connection to this addr.
addrStr := addrmgr.NetAddressKey(addr.NetAddress())
if _, ok := state.pendingPeers[addrStr]; ok {
continue
}
// XXX if we have limited that address skip
// only allow recent nodes (10mins) after we failed 30