mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +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) {
|
public boolean isSeedNode(Connection connection) {
|
||||||
//TODO
|
return connection.getPeersNodeAddressOptional().isPresent() &&
|
||||||
return connection.hasPeersNodeAddress() && seedNodeAddresses.contains(connection.getPeersNodeAddressOptional().get());
|
seedNodeAddresses.contains(connection.getPeersNodeAddressOptional().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSelf(NodeAddress nodeAddress) {
|
public boolean isSelf(NodeAddress nodeAddress) {
|
||||||
@ -306,6 +306,7 @@ public final class PeerManager implements ConnectionListener, PersistedDataHost
|
|||||||
// Peer
|
// Peer
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public Optional<Peer> findPeer(NodeAddress peersNodeAddress) {
|
public Optional<Peer> findPeer(NodeAddress peersNodeAddress) {
|
||||||
return getAllPeers().stream()
|
return getAllPeers().stream()
|
||||||
.filter(peer -> peer.getNodeAddress().equals(peersNodeAddress))
|
.filter(peer -> peer.getNodeAddress().equals(peersNodeAddress))
|
||||||
|
Loading…
Reference in New Issue
Block a user