peer: implement response to getaddr.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
peer: remove _getOwnIP.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
peer: fix potential error.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
peer: take into account omitted zeros for ipv6 addresses.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
peer: keep ips as arrays.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
framer: use varint function for addr packet.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
framer: fix 32 and 64 bit support for varint().

Signed-off-by: Fedor Indutny <fedor@indutny.com>
peer: style fixes.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
utils: add simple utils.isIP in place of net.isIP.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
peer: minor style fix.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
util: properly utilize bn.js.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
util: simplify 64bit writes using bn.js.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
util: bignum - use toArray instead of +toString.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
util: perhaps a more clever way of U64 writes using bn.js.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
util: style changes.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
getaddr: fix framer. add `addr` to protocol-test.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
util: use regular loop constructs for u64 writes.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
peer: fix handleGetAddr. fix addr test.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
peer: handle address timestamp better.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
framer: refactor.

Signed-off-by: Fedor Indutny <fedor@indutny.com>