Skip to content

Commit

Permalink
PeerGroup.addInactive(): Ignore metadata fields when checking for dup…
Browse files Browse the repository at this point in the history
…licates
  • Loading branch information
oscarguindzberg committed Apr 1, 2019
1 parent e06453c commit 3834e1f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/main/java/org/bitcoinj/core/PeerGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,14 @@ private boolean addInactive(PeerAddress peerAddress) {
lock.lock();
try {
// Deduplicate
if (backoffMap.containsKey(peerAddress)) {
boolean backoffMapContainsPeerAddress = false;
for (PeerAddress a : backoffMap.keySet()) {
if (a.equalsIgnoringMetadata(peerAddress)) {
backoffMapContainsPeerAddress = true;
break;
}
}
if (backoffMapContainsPeerAddress) {
return false;
}
backoffMap.put(peerAddress, new ExponentialBackoff(peerBackoffParams));
Expand Down

0 comments on commit 3834e1f

Please sign in to comment.