mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
fix concurrent modification exception in peer manager
This commit is contained in:
parent
497de47965
commit
59b2a1121b
1 changed files with 3 additions and 1 deletions
|
@ -774,7 +774,9 @@ public final class PeerManager implements ConnectionListener, PersistedDataHost
|
|||
// If not found in connection we look up if we got the Capabilities set from any of the
|
||||
// reported or persisted peers
|
||||
Set<Peer> persistedAndReported = new HashSet<>(getPersistedPeers());
|
||||
persistedAndReported.addAll(getReportedPeers());
|
||||
synchronized (reportedPeers) {
|
||||
persistedAndReported.addAll(reportedPeers);
|
||||
}
|
||||
Optional<Peer> candidate = persistedAndReported.stream()
|
||||
.filter(peer -> peer.getNodeAddress().equals(peersNodeAddress))
|
||||
.filter(peer -> !peer.getCapabilities().isEmpty())
|
||||
|
|
Loading…
Reference in a new issue