Commit Graph

4377 Commits

Author SHA1 Message Date
Christopher Jeffrey
0b188640ec util: use regular loop constructs for u64 writes.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:20 +04:00
Christopher Jeffrey
2aabef9a6d getaddr: fix framer. add addr to protocol-test.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:19 +04:00
Christopher Jeffrey
615292de46 util: style changes.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:19 +04:00
Christopher Jeffrey
84b53a049d util: perhaps a more clever way of U64 writes using bn.js.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:19 +04:00
Christopher Jeffrey
ca2609b7e7 util: bignum - use toArray instead of +toString.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:19 +04:00
Christopher Jeffrey
d1853b2e52 util: simplify 64bit writes using bn.js.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:19 +04:00
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
Fedor Indutny
a7880de752 tx-pool: fix update event 2014-05-10 23:18:16 +04:00
Fedor Indutny
755f3fd13c utils: fix revHex 2014-05-10 22:47:54 +04:00
Fedor Indutny
ee9037e19a lib: jshint 2014-05-10 22:43:15 +04:00
Fedor Indutny
4415f978a6 chain: kill forks :) 2014-05-10 22:31:51 +04:00
Fedor Indutny
2f2b6a9aa7 preload: fix indexes 2014-05-10 21:52:41 +04:00
Fedor Indutny
7a2c8a933f chain: set height properly 2014-05-10 20:32:37 +04:00
Fedor Indutny
169be71d79 tx: store as JSON 2014-05-10 20:22:35 +04:00
Fedor Indutny
e716f4eb00 tx-pool: fix ps check 2014-05-10 19:50:25 +04:00
Fedor Indutny
4b6eeeea66 tx-pool: ignore and remove stale transactions 2014-05-10 19:47:30 +04:00
Fedor Indutny
d49b04158f block: validate partial merkle tree 2014-05-10 19:45:03 +04:00
Fedor Indutny
50ed590c30 tx: .inputAddrs() 2014-05-10 13:04:22 +04:00
Fedor Indutny
2e3fb9a7a3 tx-pool: verify all signatures 2014-05-10 12:28:49 +04:00
Fedor Indutny
86088f8ae9 tx-pool: ignore invalid orphans 2014-05-10 11:41:27 +04:00
Fedor Indutny
0efe2e2021 script: fix verification of multisig 2014-05-10 10:39:20 +04:00
Fedor Indutny
2c5a622a66 pool: emit 'full' faster 2014-05-10 02:51:49 +04:00
Fedor Indutny
7a8d6a1018 pool: add block to chain after _response() 2014-05-10 02:05:37 +04:00
Fedor Indutny
2ee4c7cd3a tx-pool: save spending TXs 2014-05-09 21:30:55 +04:00
Fedor Indutny
cf2e0042ff tx: .maxSize() method 2014-05-09 15:51:58 +04:00
Fedor Indutny
17d0903a35 wallet: emit all added TXs 2014-05-09 15:28:26 +04:00
Fedor Indutny
af993dc66b tx-pool: emit updates only at end of .add() 2014-05-09 15:13:20 +04:00
Fedor Indutny
d4f11676c7 tx: encode as hex 2014-05-09 15:00:50 +04:00
Fedor Indutny
90ea2e24d1 wallet: .pending() 2014-05-09 14:03:00 +04:00
Fedor Indutny
26516085f2 lib: update bn.js and elliptic 2014-05-09 03:53:57 +04:00
Fedor Indutny
048bca0b8a wallet: store timestamp of transactions 2014-05-08 20:25:12 +04:00
Fedor Indutny
292da0625e chain: fixes 2014-05-08 17:47:51 +04:00
Fedor Indutny
8043be6e40 pool: make some functions asynchronous 2014-05-08 16:28:45 +04:00
Fedor Indutny
5c103aeb6c chain: storage support 2014-05-08 14:32:47 +04:00
Fedor Indutny
688b16eb98 wallet: preliminary storage support 2014-05-08 14:09:11 +04:00
Fedor Indutny
1d8574bdbd wallet: allow export/import without pub key 2014-05-08 13:50:11 +04:00
Fedor Indutny
a77083ce66 wallet: accept both private and public keys 2014-05-07 20:11:27 +04:00
Fedor Indutny
f9dc43eba2 chain: improvements 2014-05-07 16:54:22 +04:00
Fedor Indutny
4a2c54827b chain: better preload generation algorithm 2014-05-07 04:13:30 +04:00
Fedor Indutny
f95e8313b3 chain: prefer to keep more than less 2014-05-07 01:10:50 +04:00
Fedor Indutny
2a4553f6c5 preload: script to update 2014-05-06 22:08:38 +04:00
Fedor Indutny
a6be7bf5f7 lib: JSON serialization for everyone 2014-05-06 21:33:05 +04:00
Fedor Indutny
b98be4b388 pool: load interval 2014-05-06 20:46:20 +04:00
Fedor Indutny
762b53a011 pool: lower timeouts 2014-05-06 17:15:23 +04:00
Fedor Indutny
69f3e85e37 tx-pool: initial 2014-05-06 16:25:46 +04:00
Fedor Indutny
cdd3dbefb1 lib: use TX instead of Tx everywhere 2014-05-06 15:02:09 +04:00
Fedor Indutny
f139ce2d91 wallet: multisig signing 2014-05-06 14:58:51 +04:00
Fedor Indutny
fa48b02d96 tx: remove .inputTx() method 2014-05-06 14:06:17 +04:00
Fedor Indutny
c6eeb66f6d script: stricter isMultisig() 2014-05-06 13:58:35 +04:00
Fedor Indutny
403beca64b peer: proper reporting of reject 2014-05-06 13:42:17 +04:00
Fedor Indutny
f787590efe script: do not change inputs 2014-05-06 13:30:32 +04:00
Fedor Indutny
7f0ea92a43 peer: improvements 2014-05-06 00:55:24 +04:00
Fedor Indutny
fb651d703e wallet: use compressed public key 2014-05-05 17:39:22 +04:00
Fedor Indutny
62d9af1194 parser: parse reject 2014-05-05 16:52:17 +04:00
Fedor Indutny
4328d7c3ec wip 2014-05-05 13:46:29 +04:00
Fedor Indutny
c5d7d7f5f2 tx: test verification 2014-05-05 04:42:12 +04:00
Fedor Indutny
113e7dcdc3 tx: fix verification 2014-05-05 04:30:39 +04:00
Fedor Indutny
9fd54758a2 tx: wip sign/verify 2014-05-05 03:14:31 +04:00
Fedor Indutny
471a78b0fa wallet: wip sign 2014-05-05 01:58:48 +04:00
Fedor Indutny
458e606359 wip 2014-05-04 23:24:32 +04:00
Fedor Indutny
6fd7173c89 wip 2014-05-04 00:48:43 +04:00
Fedor Indutny
f185574442 lib: save progress 2014-05-03 23:55:38 +04:00
Fedor Indutny
40ea4d1fb1 tx: parse 2014-05-03 17:46:15 +04:00
Fedor Indutny
cd3f04268a block: verify 2014-05-03 16:51:16 +04:00
Fedor Indutny
1ac3208360 pool: refactor, make search work! 2014-05-03 16:11:06 +04:00
Fedor Indutny
0eecb94b3f pool: save progress 2014-05-02 18:22:06 +04:00
Fedor Indutny
b3c6eb06bc chain: fix requesting known blocks 2014-05-02 15:00:31 +04:00
Fedor Indutny
c3239b7f36 chain: preload and get 2014-05-02 14:50:21 +04:00
Fedor Indutny
9e0808eb39 pool: wip 2014-05-02 13:40:59 +04:00
Fedor Indutny
6e3cd9da85 pool: wip 2014-05-02 02:27:58 +04:00
Fedor Indutny
c71258103b pool: wip 2014-05-02 00:08:07 +04:00
Fedor Indutny
1432608813 poll: wip 2014-05-01 22:43:38 +04:00
Fedor Indutny
98bf123f5d chain: do not create duplicate orphans 2014-05-01 02:31:42 +04:00
Fedor Indutny
6cb1594424 lib: save progress 2014-04-30 21:45:55 +04:00
Fedor Indutny
a20cb1688f wip 2014-04-30 12:44:59 +04:00
Fedor Indutny
106d243873 parser: fix slicing 2014-04-28 19:57:40 +04:00
Fedor Indutny
b6a572f0c0 lib: protocol initial 2014-04-28 17:43:13 +04:00
Fedor Indutny
8a3c9d2dcd initial 2014-04-28 17:12:26 +04:00