Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PeerGroup: Add check to not duplicate peers
The inactives collection contained duplicated peerAddresses after connection loss and reconnect. We add a check to see if the to-get-added peerAddress is not already in the collection and only add it if it is absent. This problem was not discovered when using the public network as the chance that same peerAddress get reported is pretty low. But with our provided nodes we got frequently duplicates. Fixes bisq-network/bisq#1703 Cherry-pick 34461fe PeerGroup.triggerConnectionsJob: Remove isAlreadyAdded() check because it is not necessary. Cherry pick 3185434 PeerGroup.addInactive(): Remove isAlreadyAdded() check because it is not necessary. Cherry pick 7dfab73 PeerGroup.handlePeerDeath(): check isAlreadyAdded() before calling inactives.offer(address). Cherry pick de6ca8b PeerGroup.isAlreadyAdded(): refactor to ignore metadata and inline method because it is only used once. Cherry pick f790821
- Loading branch information