Add isPresent check

This commit is contained in:
chimp1984 2020-10-07 21:30:23 -05:00
parent f36a17389e
commit b748bffbfe
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3

View file

@ -147,7 +147,8 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
}, RETRY_DELAY_SEC);
}
if (peerManager.isPeerBanned(closeConnectionReason, connection))
if (peerManager.isPeerBanned(closeConnectionReason, connection) &&
connection.getPeersNodeAddressOptional().isPresent())
seedNodeAddresses.remove(connection.getPeersNodeAddressOptional().get());
}