mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Use connection.getPeersNodeAddressOptional().isPresent() instead of connection.hasPeersNodeAddress() which does the same internally
This commit is contained in:
parent
0686079946
commit
31ce5ccf67
@ -271,8 +271,8 @@ public final class PeerManager implements ConnectionListener, PersistedDataHost
|
||||
}
|
||||
|
||||
public boolean isSeedNode(Connection connection) {
|
||||
//TODO
|
||||
return connection.hasPeersNodeAddress() && seedNodeAddresses.contains(connection.getPeersNodeAddressOptional().get());
|
||||
return connection.getPeersNodeAddressOptional().isPresent() &&
|
||||
seedNodeAddresses.contains(connection.getPeersNodeAddressOptional().get());
|
||||
}
|
||||
|
||||
public boolean isSelf(NodeAddress nodeAddress) {
|
||||
@ -306,6 +306,7 @@ public final class PeerManager implements ConnectionListener, PersistedDataHost
|
||||
// Peer
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public Optional<Peer> findPeer(NodeAddress peersNodeAddress) {
|
||||
return getAllPeers().stream()
|
||||
.filter(peer -> peer.getNodeAddress().equals(peersNodeAddress))
|
||||
|
Loading…
Reference in New Issue
Block a user