Commit Graph

320 Commits

Author SHA1 Message Date
Christopher Jeffrey
999cfefe54 more pool work. wallet.fill(). 2016-02-01 10:54:52 -08:00
Christopher Jeffrey
1e027220c3 pool: refactor. 2016-01-31 00:57:34 -08:00
Christopher Jeffrey
b0ee614432 misc sync fixes. 2016-01-31 00:50:13 -08:00
Christopher Jeffrey
5ab48378cc fix addTX. 2016-01-30 02:34:35 -08:00
Christopher Jeffrey
a99725f8ff pool: remove old functions. 2016-01-30 02:31:15 -08:00
Christopher Jeffrey
8447790a84 remove peer backoff system. 2016-01-30 02:21:00 -08:00
Christopher Jeffrey
f59a1f887b increase requestTimeout. 2016-01-30 02:13:28 -08:00
Christopher Jeffrey
60c3db7cb9 better request handling. 2016-01-29 18:58:41 -08:00
Christopher Jeffrey
e8cb2102a3 work 2016-01-29 17:38:31 -08:00
Christopher Jeffrey
41516b4866 better system for avoiding duplicate txs. 2016-01-29 16:08:33 -08:00
Christopher Jeffrey
3959b9cf5d only emit new transactions. 2016-01-29 16:00:40 -08:00
Christopher Jeffrey
1115468f05 fix typos. 2016-01-29 15:56:22 -08:00
Christopher Jeffrey
e8815f3e6b version packet: minor. 2016-01-29 15:35:09 -08:00
Christopher Jeffrey
c6f91ddd69 minor fixes for tx requesting. 2016-01-29 15:32:41 -08:00
Christopher Jeffrey
e880dc5a5c pool._addTX to prevent duplicate requests. 2016-01-29 14:51:36 -08:00
Christopher Jeffrey
7ce5348cd9 debug messages. 2016-01-29 14:45:08 -08:00
Christopher Jeffrey
32c0f8ce3c do not request duplicate txs. 2016-01-29 14:44:43 -08:00
Christopher Jeffrey
b4abeceac3 handle requesting directly by peer. 2016-01-29 13:53:51 -08:00
Christopher Jeffrey
294e5a5b37 mark txs as in-flight. 2016-01-29 13:10:06 -08:00
Christopher Jeffrey
9ada551b28 auto request txs. 2016-01-29 13:00:29 -08:00
Christopher Jeffrey
3fc7272780 fix typo. 2016-01-29 12:46:25 -08:00
Christopher Jeffrey
07ddae9d33 misc fixes and improvements. 2016-01-27 19:43:24 -08:00
Christopher Jeffrey
5dce1427ba raw blocks. pool fixes. 2016-01-25 15:40:53 -08:00
Christopher Jeffrey
9a60ae8e50 add back old peer seed code. 2016-01-22 18:35:13 -08:00
Christopher Jeffrey
ef09a776fe cleanup old tries code. 2016-01-22 18:11:40 -08:00
Christopher Jeffrey
9476f7f70a remove peer "tries" system. 2016-01-22 18:09:26 -08:00
Christopher Jeffrey
8f3667b866 check range for search. 2016-01-21 04:22:37 -08:00
Christopher Jeffrey
34a44fe391 chaindb: async loading. 2016-01-21 04:10:21 -08:00
Christopher Jeffrey
dd4660eb15 chaindb: cleanup. remove old functionality. 2016-01-21 01:40:40 -08:00
Christopher Jeffrey
92619d408e chaindb/pool: fixes. work. 2016-01-21 01:28:59 -08:00
Christopher Jeffrey
ef44bf44f0 more debugging. 2016-01-20 13:35:16 -08:00
Christopher Jeffrey
271ca1aa52 better fork handling for peers. 2016-01-20 12:48:31 -08:00
Christopher Jeffrey
f6dc42924b global debugging. script.isEncoded. 2016-01-20 12:25:19 -08:00
Christopher Jeffrey
03c117b009 more DOS protection. 2016-01-20 12:04:38 -08:00
Christopher Jeffrey
ddbb7894fa potentially clean up misbehaving peers. 2016-01-20 02:54:52 -08:00
Christopher Jeffrey
009f4f9f72 debug messages for dos prevention. 2016-01-20 02:48:42 -08:00
Christopher Jeffrey
47af5987ae better system to prevent DOSing. 2016-01-20 02:46:25 -08:00
Christopher Jeffrey
c11a651e9d better loader management. 2016-01-19 20:32:59 -08:00
Christopher Jeffrey
575843acef work on chain. check for low der sigs. 2016-01-17 19:57:34 -08:00
Christopher Jeffrey
6f4609792f regtest support. tx methods. 2016-01-16 23:48:18 -08:00
Christopher Jeffrey
b1d46206a8 script fixes. 2016-01-15 19:28:17 -08:00
Christopher Jeffrey
e5a82c7195 sighash. tx signing. testnet. 2016-01-15 15:53:57 -08:00
Christopher Jeffrey
4f8d24ba36 more int and packet work. 2016-01-13 18:31:07 -08:00
Christopher Jeffrey
de455fa3e9 improve int functions and usage in parser and framer. 2016-01-12 18:13:32 -08:00
Christopher Jeffrey
f17f3b5bee pool: add startSync and stopSync. 2016-01-12 00:39:39 -08:00
Christopher Jeffrey
d316b1c640 pool: move common listeners to createPeer. 2016-01-11 22:27:59 -08:00
Christopher Jeffrey
24f8bc69c5 refactor pool and tx. 2016-01-11 22:15:06 -08:00
Christopher Jeffrey
442c984c12 improve p2sh building. change wallet key/redeem methods. 2016-01-10 21:43:52 -08:00
Christopher Jeffrey
0658444eb5 chain improvements. 2016-01-09 14:24:36 -08:00
Christopher Jeffrey
314c14f422 input/output consistency. misc. 2016-01-09 13:22:08 -08:00
Christopher Jeffrey
d56f7a3733 even more bufffer work. 2016-01-08 04:11:46 -08:00
Christopher Jeffrey
465b23013d temporarily use buffers. coinbase fixes. script/tx fixes. 2016-01-08 03:34:55 -08:00
Christopher Jeffrey
df420a4a8b refactor. work. 2016-01-08 02:22:35 -08:00
Christopher Jeffrey
c56640a433 various fixes for our miner. 2016-01-07 01:22:06 -08:00
Christopher Jeffrey
8d120a4fd6 more block verification. 2016-01-06 19:15:41 -08:00
Christopher Jeffrey
6df8319871 fix pool peers. 2016-01-06 00:35:01 -08:00
Christopher Jeffrey
680bf01e98 add tx.isFinal. refactor chain usage. 2016-01-05 21:32:31 -08:00
Christopher Jeffrey
c6c75d509b optimize chain.size() 2016-01-05 16:07:11 -08:00
Christopher Jeffrey
8e698673a0 fix typo. emit resolved entries. 2016-01-05 14:25:14 -08:00
Christopher Jeffrey
d0d5ab2c3b add mempool packet. miner refactor. 2016-01-05 12:46:30 -08:00
Christopher Jeffrey
ff08f73fa9 check orphan size. misc. 2016-01-05 03:25:53 -08:00
Christopher Jeffrey
8a930ac037 drop missing event. fix for spv chain. pool.search improvements. 2016-01-05 02:45:57 -08:00
Christopher Jeffrey
2f618c961b fixes. peer improvements. 2016-01-05 02:28:06 -08:00
Christopher Jeffrey
019ecf4f2a switch to fullchain for both spv and fullnode. 2016-01-04 20:13:06 -08:00
Christopher Jeffrey
582a21fd5a getblocks failing for spv. 2016-01-04 18:31:27 -08:00
Christopher Jeffrey
0a97cebf25 improve getblocks download, spv chain, and events. 2016-01-04 18:22:42 -08:00
Christopher Jeffrey
2c3edd50aa chain: improve locatorHashes. 2016-01-04 16:33:52 -08:00
Christopher Jeffrey
10fce032b7 improve locatorHashes. fix utils ref in tx-pool. add utils.hash. 2016-01-04 15:12:50 -08:00
Christopher Jeffrey
d1595c0ec4 use getheaders by default. fix header parsing and handling. 2016-01-04 13:14:09 -08:00
Christopher Jeffrey
50e606f625 fix pool.isWatched. 2016-01-04 10:37:58 -08:00
Christopher Jeffrey
6758d4fe8a chain and search fixes. options. 2016-01-04 04:33:49 -08:00
Christopher Jeffrey
0f8819c78e minor fixes. refactor timestamps. 2016-01-04 04:12:26 -08:00
Christopher Jeffrey
a20cd7edbe refactor pool. improve chains. 2016-01-04 03:04:09 -08:00
Christopher Jeffrey
484b1f2817 use getheaders. 2016-01-03 06:47:27 -08:00
Christopher Jeffrey
73262b74ba pool.searchWallet failsafe for fullnode. 2016-01-02 05:19:19 -08:00
Christopher Jeffrey
9c904f7b4f fix potential uncatchable error. 2016-01-02 05:16:58 -08:00
Christopher Jeffrey
35ba5a5de5 refactor chain methods. check for orphans during fullnode sync. 2016-01-02 04:32:04 -08:00
Christopher Jeffrey
7a8a7a5a2b better wallet searching for spv. pool methods. 2016-01-02 03:44:25 -08:00
Christopher Jeffrey
ff16271c1a comments. remove useless variable. 2016-01-02 00:26:19 -08:00
Christopher Jeffrey
9976208d0d comments. misc. 2016-01-02 00:16:36 -08:00
Christopher Jeffrey
8b546a85e0 check for fullNode in handleBlock and handleMerkle. 2016-01-01 19:14:34 -08:00
Christopher Jeffrey
4c1a3761af set relay to false on spv. 2016-01-01 18:07:18 -08:00
Christopher Jeffrey
eee2ef5d34 improve pool/chain options. 2016-01-01 17:54:22 -08:00
Christopher Jeffrey
90856a8f5b add size method. 2016-01-01 17:42:02 -08:00
Christopher Jeffrey
3c5a823445 allow watch() to be used on a full node. 2016-01-01 17:42:02 -08:00
Christopher Jeffrey
146e50dc68 add fullnode chain. improve pool. 2016-01-01 17:41:13 -08:00
Christopher Jeffrey
65dd1727be push wallet in pool.addWallet. 2016-01-01 14:21:10 -08:00
Christopher Jeffrey
350ca9c875 move all block sync logic to pool. 2015-12-29 18:40:31 -08:00
Christopher Jeffrey
43b0533a18 minor improvements and fixes. 2015-12-27 23:54:53 -08:00
Christopher Jeffrey
52b653083c add features potentially useful for blockchain explorers. 2015-12-21 20:00:13 -08:00
Christopher Jeffrey
a96f27682f style. fix addr timestamp. 2015-12-19 02:17:01 -08:00
Christopher Jeffrey
d3811acc28 move chain.on("fork") somewhere sane. 2015-12-19 02:08:42 -08:00
Christopher Jeffrey
1e802c152f comments. more style consistency. 2015-12-18 22:53:31 -08:00
Christopher Jeffrey
5ece45091b style consistency. 2015-12-18 22:37:02 -08:00
Christopher Jeffrey
9fe8afa7d3 emit orphan event. 2015-12-18 20:33:19 -08:00
Christopher Jeffrey
7cabdcfda5 fix getOrphanRoot and usage. 2015-12-18 17:31:45 -08:00
Christopher Jeffrey
e735249d0d try to choose from at least 5 potential peers when syncing. 2015-12-18 16:52:32 -08:00
Christopher Jeffrey
086b32cb73 minor: initialize syncPeer. 2015-12-18 16:39:29 -08:00
Christopher Jeffrey
cf502913b6 check to see if chain is synced. 2015-12-18 16:35:00 -08:00
Christopher Jeffrey
34e90c6baa handle chain forks from checkpoints. enforce one syncPeer. 2015-12-18 16:30:58 -08:00
Christopher Jeffrey
7ffcc8e7f3 check for syncPeer on blockchain fork. 2015-12-18 13:12:04 -08:00
Christopher Jeffrey
91618258e7 add a peers.bad list for peers with forked blockchains. 2015-12-18 13:10:27 -08:00
Christopher Jeffrey
82983af52b pool wallets. chain errors. checkpoint failure. 2015-12-18 12:10:39 -08:00
Christopher Jeffrey
d109eaba6c handle reject packet. 2015-12-17 19:47:20 -08:00
Christopher Jeffrey
3e608c2cc6 script and standard transaction types. prefixes. 2015-12-17 16:06:08 -08:00
Christopher Jeffrey
07a6788831 optimize block and tx rendering. script maxes. sync. 2015-12-17 16:06:08 -08:00
Christopher Jeffrey
88ddb3620c get blockchain sync working. fix pushdata ops. 2015-12-17 16:05:48 -08:00
Christopher Jeffrey
8a33f2efa1 add getFullPublicKey/getOwnPublicKey and use appropriately. 2015-12-08 19:42:12 -08:00
Christopher Jeffrey
db0da78ae5 only start calculating startHeight and locatorHashes after chain load. 2015-12-05 18:34:18 -08:00
Christopher Jeffrey
ea9af49f4b hd and p2sh 2015-12-04 18:01:31 -08:00
Christopher Jeffrey
3bfd10d0d0 work 2015-12-01 22:59:26 -08:00
Christopher Jeffrey
fcc9d661c1 satoshi: fix blockchain download. 2015-11-30 18:15:57 -08:00
Christopher Jeffrey
feda74523f peer/pool: add origin satoshi protocol. 2015-11-30 12:36:39 -08:00
Christopher Jeffrey
96e1cbb0e1 pool: emit peer in tx broadcast. 2014-06-11 18:43:50 -05:00
Christopher Jeffrey
2697d37753 Merge pull request #25 from indutny/peer-events
Peer events
2014-06-07 03:48:43 -05:00
Christopher Jeffrey
9363aff634 pool: pass peer in through error events...again. 2014-06-07 03:40:42 -05:00
Christopher Jeffrey
d577b7cbd3 pool: pass peer in through error events. 2014-06-07 03:39:05 -05:00
Christopher Jeffrey
eadb7a50c7 pool: add version and peer events for peers. 2014-06-06 16:20:50 -05:00
Christopher Jeffrey
11b56e32d7 fix: do not throw on destroyed peers. 2014-06-06 06:37:47 -05:00
Christopher Jeffrey
8d6c438e3d pool: stop throwing uncatchable errors on parser errors. 2014-06-02 02:29:15 -05:00
Fedor Indutny
013a85c6a5 Merge pull request #16 from chjj/version-packet
Version packet
2014-05-26 22:12:36 +04:00
Christopher Jeffrey
1b88b355ac chain: add a cacheLimit option to chain. 2014-05-26 12:53:47 -05:00
Christopher Jeffrey
7e38e4de7c pool: change pool.options.satoshi to pool.options.relay. 2014-05-26 12:43:41 -05:00
Christopher Jeffrey
024350dbe4 peer/pool: improve handleInv. improve addPeer. 2014-05-26 04:03:23 -05:00
Christopher Jeffrey
24d9b2b2d8 pool: allow sending filterload to peers without an id to add to the bloom filter. 2014-05-24 02:16:59 -05:00
Christopher Jeffrey
a5f20114e8 framer: version packet options, relay and height. 2014-05-24 02:16:59 -05:00
Christopher Jeffrey
7de6964628 allow usage of the original non-spv pre BIP-37 satoshi protocol. 2014-05-23 10:56:02 -05:00
Christopher Jeffrey
f4dbc0ee33 parser: parse transactions in regular blocks. 2014-05-23 10:05:46 -05: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
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
Fedor Indutny
c69660d81d pool: fix relay of pending TX 2014-05-15 15:08:33 +04:00
Fedor Indutny
2365e10d9b pool: support adding and removing wallets 2014-05-15 12:56:19 +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
Fedor Indutny
f7300fb979 peer: backoff randomly to not spin on reconnect 2014-05-13 15:13:52 +04:00
Fedor Indutny
516b64f0cb pool: add .isFull() 2014-05-12 16:32:57 +04:00
Fedor Indutny
dfdc69aa3a lib: remove heavy modules 2014-05-11 14:27:05 +04:00
Fedor Indutny
6d99072caf pool: fix finalization 2014-05-11 11:42:48 +04:00
Fedor Indutny
ee9037e19a lib: jshint 2014-05-10 22:43:15 +04:00
Fedor Indutny
169be71d79 tx: store as JSON 2014-05-10 20:22:35 +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
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
1d8574bdbd wallet: allow export/import without pub key 2014-05-08 13:50:11 +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
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
cdd3dbefb1 lib: use TX instead of Tx everywhere 2014-05-06 15:02:09 +04:00
Fedor Indutny
403beca64b peer: proper reporting of reject 2014-05-06 13:42:17 +04:00
Fedor Indutny
7f0ea92a43 peer: improvements 2014-05-06 00:55:24 +04:00
Fedor Indutny
4328d7c3ec wip 2014-05-05 13:46:29 +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
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
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
6cb1594424 lib: save progress 2014-04-30 21:45:55 +04:00