Commit Graph

121 Commits

Author SHA1 Message Date
Christopher Jeffrey
5ee3fbcf72 util: properly utilize bn.js.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:19 +04:00
Christopher Jeffrey
9bec16ca49 peer: minor style fix.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:19 +04:00
Christopher Jeffrey
29746b5164 utils: add simple utils.isIP in place of net.isIP.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:18 +04:00
Christopher Jeffrey
2edfdd8b36 peer: style fixes.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:18 +04:00
Christopher Jeffrey
5c5762a000 framer: fix 32 and 64 bit support for varint().
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:18 +04:00
Christopher Jeffrey
e89eb925e6 framer: use varint function for addr packet.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:18 +04:00
Christopher Jeffrey
6e8b03df96 peer: keep ips as arrays.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:18 +04:00
Christopher Jeffrey
aa383b984e peer: take into account omitted zeros for ipv6 addresses.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:18 +04:00
Christopher Jeffrey
e9ec9a5f0c peer: fix potential error.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:18 +04:00
Christopher Jeffrey
b2c4af302d peer: remove _getOwnIP.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:17 +04:00
Christopher Jeffrey
d0b14008d0 peer: implement response to getaddr.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:17 +04:00
Christopher Jeffrey
d617edf3ab chain: fix undefined var in storage.del call.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-19 12:13:15 +04:00
Christopher Jeffrey
db69c882f2 block: add block tests. frame correct version for blocks.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-19 00:21:41 +04:00
Christopher Jeffrey
745473784f block: style concerns. fix type variable.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-19 00:21:41 +04:00
Christopher Jeffrey
810e4f5ea7 block: add toJSON and fromJSON to Block.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-19 00:21:41 +04:00
Christopher Jeffrey
f3c9ebd9a5 framer: fix block framing.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 21:00:56 +04:00
Christopher Jeffrey
6d9c150134 framer: fix typo.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 21:00:56 +04:00
Christopher Jeffrey
e04931026c block: add block subtype - block or merkleblock.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 21:00:56 +04:00
Christopher Jeffrey
2b5f8693bf framer: add tx, block, and merkleblock packet sending to the framer.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 21:00:56 +04:00
Christopher Jeffrey
3998146046 block: avoid error by ensuring hashes and flags for non-merkleblocks.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 21:00:55 +04:00
Christopher Jeffrey
296f95b27b tx: fix global variable assignment.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 21:00:55 +04:00
Christopher Jeffrey
4894f6965f peer: txs event - only emit hashes to mimic blocks event.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 18:09:41 +04:00
Christopher Jeffrey
2ab9334b4b pool: when proxying peer->pool events. pass peer as the 2nd arg.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 18:09:41 +04:00
Christopher Jeffrey
01409b34af pool: emit blocks and txs event on pool.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 18:09:40 +04:00
Christopher Jeffrey
b041d3ae99 chain: misc fixes.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 18:09:40 +04:00
Christopher Jeffrey
d331cfbb9e fix: take into account var_int for addr. move to parser.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-17 21:03:51 +04:00
lms
67298c60e0 peer: socket -> createSocket parameter
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-16 01:28:59 +04:00
Christopher Jeffrey
24779fb398 peer/pool: emit addr event on pool. refactor addr handler.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-16 01:28:17 +04:00
Christopher Jeffrey
b2ee0891a1 peer: remove useless map call.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-16 01:28:17 +04:00
Fedor Indutny
c69660d81d pool: fix relay of pending TX 2014-05-15 15:08:33 +04:00
Fedor Indutny
abf34321f6 wallet: fix .loaded without storage 2014-05-15 13:31:56 +04:00
Fedor Indutny
2365e10d9b pool: support adding and removing wallets 2014-05-15 12:56:19 +04:00
Fedor Indutny
7e72a4d79d utils: toBTC() 2014-05-15 02:59:07 +04:00
Christopher Jeffrey
e76bed360f peer: handle addr packet.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-15 00:55:45 +04:00
Christopher Jeffrey
d5f29c37b4 script: fix undefined error.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-15 00:31:10 +04:00
Fedor Indutny
b425cb4639 pool: proper backoff 2014-05-14 19:24:28 +04:00
Fedor Indutny
a672b955c9 pool: fix search 2014-05-14 16:27:59 +04:00
Fedor Indutny
8535fa6fa7 lib: searialize searches 2014-05-14 15:01:37 +04:00
lms
9ed4f0f4df remove global (not that it matters but looks prettier in my emacs) 2014-05-13 21:25:30 +02:00
Fedor Indutny
f7300fb979 peer: backoff randomly to not spin on reconnect 2014-05-13 15:13:52 +04:00
Fedor Indutny
2a6048f104 wallet: emit updates with tx 2014-05-13 01:11:33 +04:00
Fedor Indutny
3b2fd8e168 parser: support Uint8Array's 2014-05-12 20:54:51 +04:00
Fedor Indutny
516b64f0cb pool: add .isFull() 2014-05-12 16:32:57 +04:00
Fedor Indutny
3fe7d097ec parser: make sure to not fail synchronously 2014-05-12 13:04:52 +04:00
Fedor Indutny
dfdc69aa3a lib: remove heavy modules 2014-05-11 14:27:05 +04:00
Fedor Indutny
ee9b9cf0e2 wallet: asyncify .fill() 2014-05-11 11:47:00 +04:00
Fedor Indutny
6d99072caf pool: fix finalization 2014-05-11 11:42:48 +04:00
Fedor Indutny
3ef7008a32 wallet: make .fill() throw 2014-05-11 02:41:00 +04:00
Fedor Indutny
2c36c8692a wallet: .fill() 2014-05-11 01:43:20 +04:00
Fedor Indutny
8cd092dc2e lib: fix chain.isFull() 2014-05-10 23:35:22 +04:00