diff --git a/lib/bcoin/peer.js b/lib/bcoin/peer.js index 302951f2..2c0898fd 100644 --- a/lib/bcoin/peer.js +++ b/lib/bcoin/peer.js @@ -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); diff --git a/lib/bcoin/protocol/framer.js b/lib/bcoin/protocol/framer.js index 7e0a5733..bad3f686 100644 --- a/lib/bcoin/protocol/framer.js +++ b/lib/bcoin/protocol/framer.js @@ -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);