peer: take into account omitted zeros for ipv6 addresses.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Christopher Jeffrey 2014-05-17 01:52:48 -05:00 committed by Fedor Indutny
parent e9ec9a5f0c
commit aa383b984e

View File

@ -384,7 +384,7 @@ Peer.prototype._handleGetAddr = function handleGetAddr() {
});
peer.ipv6 = peer.ipv6.split(':').slice(5).map(function(n) {
return parseInt(n, 16);
return parseInt(n || 0, 16);
});
peer.ipv4 = utils.readU32BE(peer.ipv4, 0);