mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Refactor: Rename method
This commit is contained in:
parent
ed960aba3f
commit
0686079946
@ -180,7 +180,7 @@ public class LiteNodeNetworkService implements MessageListener, ConnectionListen
|
||||
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) {
|
||||
closeHandler(connection);
|
||||
|
||||
if (peerManager.isNodeBanned(closeConnectionReason, connection)) {
|
||||
if (peerManager.isPeerBanned(closeConnectionReason, connection)) {
|
||||
connection.getPeersNodeAddressOptional().ifPresent(nodeAddress -> {
|
||||
seedNodeAddresses.remove(nodeAddress);
|
||||
removeFromRequestBlocksHandlerMap(nodeAddress);
|
||||
|
@ -287,14 +287,13 @@ public final class PeerManager implements ConnectionListener, PersistedDataHost
|
||||
return seedNodeAddresses.contains(nodeAddress);
|
||||
}
|
||||
|
||||
//TODO rename
|
||||
public boolean isNodeBanned(CloseConnectionReason closeConnectionReason, Connection connection) {
|
||||
public boolean isPeerBanned(CloseConnectionReason closeConnectionReason, Connection connection) {
|
||||
return closeConnectionReason == CloseConnectionReason.PEER_BANNED &&
|
||||
connection.getPeersNodeAddressOptional().isPresent();
|
||||
}
|
||||
|
||||
private void maybeRemoveBannedPeer(CloseConnectionReason closeConnectionReason, Connection connection) {
|
||||
if (connection.getPeersNodeAddressOptional().isPresent() && isNodeBanned(closeConnectionReason, connection)) {
|
||||
if (connection.getPeersNodeAddressOptional().isPresent() && isPeerBanned(closeConnectionReason, connection)) {
|
||||
NodeAddress nodeAddress = connection.getPeersNodeAddressOptional().get();
|
||||
seedNodeAddresses.remove(nodeAddress);
|
||||
removePersistedPeer(nodeAddress);
|
||||
|
@ -210,8 +210,8 @@ public class RequestDataManager implements MessageListener, ConnectionListener,
|
||||
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) {
|
||||
closeHandler(connection);
|
||||
|
||||
if (peerManager.isNodeBanned(closeConnectionReason, connection) && connection.getPeersNodeAddressOptional().isPresent()) {
|
||||
final NodeAddress nodeAddress = connection.getPeersNodeAddressOptional().get();
|
||||
if (peerManager.isPeerBanned(closeConnectionReason, connection) && connection.getPeersNodeAddressOptional().isPresent()) {
|
||||
NodeAddress nodeAddress = connection.getPeersNodeAddressOptional().get();
|
||||
seedNodeAddresses.remove(nodeAddress);
|
||||
handlerMap.remove(nodeAddress);
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
|
||||
}, RETRY_DELAY_SEC);
|
||||
}
|
||||
|
||||
if (peerManager.isNodeBanned(closeConnectionReason, connection))
|
||||
if (peerManager.isPeerBanned(closeConnectionReason, connection))
|
||||
seedNodeAddresses.remove(connection.getPeersNodeAddressOptional().get());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user