peer: keep ips as arrays.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
aa383b984e
commit
6e8b03df96
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user