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:
parent
8469c8fd86
commit
1cf1147c87
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user