peer: fix potential error.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
b2c4af302d
commit
e9ec9a5f0c
@ -355,7 +355,7 @@ Peer.prototype._handleGetAddr = function handleGetAddr() {
|
||||
port: peer.socket.remotePort || 8333
|
||||
};
|
||||
}).filter(function(peer) {
|
||||
if (~used.indexOf(peer.host)) return;
|
||||
if (!peer || ~used.indexOf(peer.host)) return;
|
||||
used.push(peer.host);
|
||||
return !!peer.host && net.isIP(peer.host);
|
||||
}).map(function(peer) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user