Skip to content

Commit

Permalink
PeerGroup.handlePeerDeath(): check isAlreadyAdded() before calling in…
Browse files Browse the repository at this point in the history
…actives.offer(address).
  • Loading branch information
oscarguindzberg committed Apr 1, 2019
1 parent cc0f5db commit 2d7c24c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/bitcoinj/core/PeerGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,9 @@ protected void handlePeerDeath(final Peer peer, @Nullable Throwable exception) {
} else {
backoffMap.get(address).trackFailure();
// Put back on inactive list
inactives.offer(address);
if (!isAlreadyAdded(address)) {
inactives.offer(address);
}
}

if (numPeers < getMaxConnections()) {
Expand Down

0 comments on commit 2d7c24c

Please sign in to comment.