fix a NPE
This commit is contained in:
@ -549,16 +549,20 @@ public class EstablishState {
|
||||
Signature sig = new Signature(s);
|
||||
_verified = _context.dsa().verifySignature(sig, toVerify, alice.getSigningPublicKey());
|
||||
if (_verified) {
|
||||
byte[] ip = _con.getChannel().socket().getInetAddress().getAddress();
|
||||
// get inet-addr
|
||||
InetAddress addr = this._con.getChannel().socket().getInetAddress();
|
||||
byte[] ip = (addr == null) ? null : addr.getAddress();
|
||||
if (_context.shitlist().isShitlistedForever(alice.calculateHash())) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Dropping inbound connection from permanently shitlisted peer: " + alice.calculateHash().toBase64());
|
||||
// So next time we will not accept the con from this IP,
|
||||
// rather than doing the whole handshake
|
||||
if(ip != null)
|
||||
_context.blocklist().add(ip);
|
||||
fail("Peer is shitlisted forever: " + alice.calculateHash().toBase64());
|
||||
return;
|
||||
}
|
||||
if(ip != null)
|
||||
_transport.setIP(alice.calculateHash(), ip);
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug(prefix() + "verification successful for " + _con);
|
||||
|
Reference in New Issue
Block a user