3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 06:44:16 +00:00

Ensure peer is disconnected in PeerGroup

This commit is contained in:
Miron Cuperman (devrandom) 2011-07-25 22:08:58 +00:00
parent 8469c8fd86
commit 1cf1147c87

View File

@ -228,8 +228,14 @@ public class PeerGroup {
// do not propagate RuntimeException - log and try next peer
log.error("error while talking to peer", ex);
} finally {
// In all cases, put the address back on the queue.
// In all cases, disconnect and put the address back on the queue.
// We will retry this peer after all other peers have been tried.
try {
peer.disconnect();
} catch (RuntimeException ex) {
// ignore
}
inactives.add(address);
if (peers.remove(peer))
handlePeerDeath(peer);