peer: keep ips as arrays.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Christopher Jeffrey 2014-05-17 01:58:50 -05:00 committed by Fedor Indutny
parent aa383b984e
commit 6e8b03df96
2 changed files with 1 additions and 6 deletions

View File

@ -387,11 +387,6 @@ Peer.prototype._handleGetAddr = function handleGetAddr() {
return parseInt(n || 0, 16);
});
peer.ipv4 = utils.readU32BE(peer.ipv4, 0);
peer.ipv6 = utils.readU32BE(peer.ipv6, 0)
* 0x10000 + utils.readU16BE(peer.ipv6, 4);
return peer;
}).filter(Boolean);

View File

@ -356,7 +356,7 @@ Framer.prototype.addr = function addr(peers) {
c += utils.writeU16BE(p, utils.readU16BE(peer.ipv6, 4), c);
// ipv4
c += utils.writeU32BE(p, peer.ipv4, c);
c += utils.writeU32BE(p, utils.readU32BE(peer.ipv4, 0), c);
// port
c += utils.writeU16BE(peer.port, c);