Commit Graph

369 Commits

Author SHA1 Message Date
Christopher Jeffrey
c559f97c26 add chain._checkReward. 2016-02-23 21:02:50 -08:00
Christopher Jeffrey
78e9be11c3 switch to buffers. 2016-02-22 20:37:15 -08:00
Christopher Jeffrey
c0bb66bf73 refactor orphan root. 2016-02-22 15:16:50 -08:00
Christopher Jeffrey
0dc1b1cc5f fix orphan resolution. 2016-02-22 14:35:13 -08:00
Christopher Jeffrey
9ddc23227c fix LoadRequest. misc. 2016-02-22 13:52:03 -08:00
Christopher Jeffrey
cbed3bbc4f fsync all chain writes. 2016-02-22 04:54:07 -08:00
Christopher Jeffrey
0f4d2ca281 use async helpers. 2016-02-22 04:25:20 -08:00
Christopher Jeffrey
86b228ca07 add utils.once. some async functions. disable blockdb truncate. 2016-02-22 03:09:48 -08:00
Christopher Jeffrey
6b6a84a774 full json. cache. 2016-02-22 01:54:42 -08:00
Christopher Jeffrey
21ff3f1d78 fix orphan pruning. 2016-02-22 00:00:26 -08:00
Christopher Jeffrey
d6bef43d71 add http server. 2016-02-21 22:48:42 -08:00
Christopher Jeffrey
2ce5848d4c fix horrible typo. 2016-02-21 16:26:51 -08:00
Christopher Jeffrey
c81770c2b1 move some deps around. drop inherits. 2016-02-21 06:31:15 -08:00
Christopher Jeffrey
6e2eb039ac add spv node. add .bcoin dir. add file storage for wallet. 2016-02-20 16:53:10 -08:00
Christopher Jeffrey
28274cdba4 rename methods. 2016-02-19 21:42:44 -08:00
Christopher Jeffrey
ad7cd04e79 minor. 2016-02-19 21:22:22 -08:00
Christopher Jeffrey
509ed09603 better existence check. 2016-02-19 21:13:22 -08:00
Christopher Jeffrey
8ed054cbda handle verification better. make use of cache. 2016-02-19 21:00:38 -08:00
Christopher Jeffrey
ad95ffbfcd do verification on forked blocks. 2016-02-19 20:45:02 -08:00
Christopher Jeffrey
70553c884c better check for existing blocks. 2016-02-19 20:30:36 -08:00
Christopher Jeffrey
a9ec49f954 misc fixes. 2016-02-19 19:48:24 -08:00
Christopher Jeffrey
348049a5c3 refactor 2016-02-19 11:18:35 -08:00
Christopher Jeffrey
53158edf4f purge pending. 2016-02-19 11:16:39 -08:00
Christopher Jeffrey
3c3e9a496a more chain improvements. 2016-02-19 11:10:45 -08:00
Christopher Jeffrey
af59208ad5 cleanup 2016-02-19 09:49:07 -08:00
Christopher Jeffrey
fc5187bb26 fix some blockdb stuff. 2016-02-19 09:19:34 -08:00
Christopher Jeffrey
a558cbfb57 lower limits. 2016-02-19 09:13:18 -08:00
Christopher Jeffrey
a6668f860f experiment with _lock. 2016-02-19 09:10:50 -08:00
Christopher Jeffrey
bccc833299 play around with _lock method. 2016-02-19 08:35:46 -08:00
Christopher Jeffrey
3a63da5735 async work. 2016-02-19 08:07:50 -08:00
Christopher Jeffrey
cefeaf779b better block sync. 2016-02-19 07:49:14 -08:00
Christopher Jeffrey
7c3191aee8 fix chaindb queue system. 2016-02-19 06:30:10 -08:00
Christopher Jeffrey
7df05b971d async resets. 2016-02-19 05:54:23 -08:00
Christopher Jeffrey
053775ffac sync resetHeight 2016-02-19 05:38:02 -08:00
Christopher Jeffrey
9ff7e93c71 move sigop counting to checkInputs. 2016-02-19 04:16:29 -08:00
Christopher Jeffrey
9bc3e44a7f misc method improvements. 2016-02-19 03:08:50 -08:00
Christopher Jeffrey
71557ba95c more chain improvements. 2016-02-19 02:14:10 -08:00
Christopher Jeffrey
5f67f78170 chain fixes. 2016-02-19 01:42:59 -08:00
Christopher Jeffrey
8b17c09116 move more logic into chaindb. 2016-02-18 22:52:51 -08:00
Christopher Jeffrey
5053fa2eeb move height lookups to chaindb. 2016-02-18 21:01:34 -08:00
Christopher Jeffrey
d2a4f995fd add some async functions. 2016-02-18 18:36:25 -08:00
Christopher Jeffrey
469d3c35d0 _revertLast. 2016-02-18 17:41:47 -08:00
Christopher Jeffrey
42f5ece282 refactor mempool events from chain. 2016-02-18 17:30:15 -08:00
Christopher Jeffrey
050d801849 standardness. chain. pool. 2016-02-18 15:26:03 -08:00
Christopher Jeffrey
4b672d6337 fix sigops counting. 2016-02-18 01:45:47 -08:00
Christopher Jeffrey
ff467afaff minor. 2016-02-18 01:12:39 -08:00
Christopher Jeffrey
d22dc02e8f wait for flush. 2016-02-17 19:40:56 -08:00
Christopher Jeffrey
6ef09f39ec better events. 2016-02-17 17:07:12 -08:00
Christopher Jeffrey
f7ac99d24d minor refactoring. 2016-02-17 16:02:11 -08:00
Christopher Jeffrey
d4aa15f9a3 remove old error code system. 2016-02-17 15:39:20 -08:00
Christopher Jeffrey
5d9f106e2a event based system for chain error handling. 2016-02-17 15:30:33 -08:00
Christopher Jeffrey
7a04ac25d0 add queue back to handleBlock. 2016-02-17 13:04:26 -08:00
Christopher Jeffrey
a208083dc5 do not increment total on orphans. 2016-02-17 12:55:48 -08:00
Christopher Jeffrey
a485a1d334 move queue to the chain. 2016-02-17 12:52:22 -08:00
Christopher Jeffrey
90b3c16837 debugging. 2016-02-17 01:16:01 -08:00
Christopher Jeffrey
7b14c3b72b debugging. 2016-02-17 00:14:25 -08:00
Christopher Jeffrey
2dc3786eb0 refactor 2016-02-16 21:04:10 -08:00
Christopher Jeffrey
d0d0378f3e queue. fixes. 2016-02-16 21:01:31 -08:00
Christopher Jeffrey
0191acd530 blockdb reset height. 2016-02-16 17:19:14 -08:00
Christopher Jeffrey
997f0acbb0 more refactoring. 2016-02-16 16:13:34 -08:00
Christopher Jeffrey
ab610d6fa5 new verifyContext. 2016-02-16 14:27:46 -08:00
Christopher Jeffrey
02e4c9e266 fix verifyContext. 2016-02-16 14:08:56 -08:00
Christopher Jeffrey
fe46d1ada5 contextual verification. misc. 2016-02-16 13:45:02 -08:00
Christopher Jeffrey
e912f78814 async chain. 2016-02-16 03:03:11 -08:00
Christopher Jeffrey
686dcbcdd9 minor fixes. 2016-02-12 01:20:05 -08:00
Christopher Jeffrey
6cc4c866dc wallet refactor. fixes. 2016-02-10 16:42:02 -08:00
Christopher Jeffrey
17e25804de better preload. misc fixes. 2016-02-09 00:07:38 -08:00
Christopher Jeffrey
05d4eab0d8 add preload option. better errors. 2016-02-08 21:05:27 -08:00
Christopher Jeffrey
bcd68c4ed8 fix callback. 2016-02-08 20:49:50 -08:00
Christopher Jeffrey
36c3d72021 add preload from electrum.org. check for blockchain corruption. 2016-02-08 20:46:57 -08:00
Christopher Jeffrey
adb304748f add some data integrity checks when loading the chain. 2016-02-08 19:55:56 -08:00
Christopher Jeffrey
d20b3b8737 move chaindb and chainblock to their own modules. 2016-02-08 19:01:30 -08:00
Christopher Jeffrey
72b7adc800 get bcoin working in the browser again. 2016-02-08 18:06:39 -08:00
Christopher Jeffrey
2ec7989b6a no more dynamic heights. 2016-02-06 21:51:38 -08:00
Christopher Jeffrey
e0ab0ab88d minor changes/fixes. 2016-02-03 02:09:03 -08:00
Christopher Jeffrey
f9d960ca23 api: more method renames. legacy support. docs. 2016-02-01 11:57:40 -08:00
Christopher Jeffrey
6ad621cace api: rename methods, properties. add legacy support. 2016-02-01 11:50:09 -08:00
Christopher Jeffrey
4cc9b93fdd fix resetHeight. 2016-01-27 11:01:45 -08:00
Christopher Jeffrey
b98640b27e drop preload constants. 2016-01-25 13:46:40 -08:00
Christopher Jeffrey
f3980ca029 deprecate chain.getTip(). 2016-01-25 11:58:22 -08:00
Christopher Jeffrey
0d7929136a fix getChainwork. 2016-01-23 22:00:19 -08:00
Christopher Jeffrey
7526beace0 chaindb: minor. 2016-01-23 19:36:34 -08:00
Christopher Jeffrey
9b266c6ec7 minor. 2016-01-21 18:28:46 -08:00
Christopher Jeffrey
cdfe7b6ec5 add assert. 2016-01-21 18:10:04 -08:00
Christopher Jeffrey
93e0fe95d0 chaindb: back to async writes. 2016-01-21 14:35:13 -08:00
Christopher Jeffrey
32109c5de5 chaindb: error handling. 2016-01-21 14:31:32 -08:00
Christopher Jeffrey
a459d190aa use async writes. 2016-01-21 14:10:01 -08:00
Christopher Jeffrey
cb73ab908e chaindb: add allocator. 2016-01-21 14:01:32 -08:00
Christopher Jeffrey
7c2171966c chaindb: minor fixes. 2016-01-21 13:43:04 -08:00
Christopher Jeffrey
34a44fe391 chaindb: async loading. 2016-01-21 04:10:21 -08:00
Christopher Jeffrey
c5bc356bc9 add getAsync. 2016-01-21 03:58:33 -08:00
Christopher Jeffrey
b65ed25b29 chaindb: fix async. 2016-01-21 03:48:39 -08:00
Christopher Jeffrey
b273bec120 chaindb: checksum. 2016-01-21 03:39:36 -08:00
Christopher Jeffrey
ef51f4f842 chaindb: recovery. 2016-01-21 03:24:29 -08:00
Christopher Jeffrey
c950a30330 chaindb: better loading. 2016-01-21 02:23:01 -08:00
Christopher Jeffrey
495dda79ef fix assert. 2016-01-21 02:02:44 -08:00
Christopher Jeffrey
18f1412ba7 rename functions. 2016-01-21 01:58:21 -08:00
Christopher Jeffrey
95ff41dde9 move saveAsync elsewhere. 2016-01-21 01:56:01 -08:00
Christopher Jeffrey
c3943c0111 chaindb. avoid buffered writes. 2016-01-21 01:50:22 -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
9a575e9a26 chain: use binary search for byTime. 2016-01-20 22:32:32 -08:00
Christopher Jeffrey
423b52b0b7 chaindb: minor. 2016-01-20 21:14:50 -08:00
Christopher Jeffrey
f62cf7dc6e chaindb: use buffers. 2016-01-20 20:10:05 -08:00
Christopher Jeffrey
d5d3dd69e2 chaindb: minor improvements. 2016-01-20 20:06:43 -08:00
Christopher Jeffrey
43a365962b cleanup chain db. fixes. 2016-01-20 19:56:47 -08:00
Christopher Jeffrey
f6a35d0810 more chain db work. 2016-01-20 18:18:27 -08:00
Christopher Jeffrey
c111d673e7 blockchain db. 2016-01-20 17:40:51 -08:00
Christopher Jeffrey
e461e44303 save memory by not storing prevBlock. 2016-01-20 13:58:11 -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
47af5987ae better system to prevent DOSing. 2016-01-20 02:46:25 -08:00
Christopher Jeffrey
486c22d0e7 get rid of getStartHeight. 2016-01-19 20:36:48 -08:00
Christopher Jeffrey
911f9534e4 fix testnet targetting. 2016-01-18 12:14:33 -08:00
Christopher Jeffrey
575843acef work on chain. check for low der sigs. 2016-01-17 19:57:34 -08:00
Christopher Jeffrey
46b2983eb3 update preload. 2016-01-17 17:15:13 -08:00
Christopher Jeffrey
6f4609792f regtest support. tx methods. 2016-01-16 23:48:18 -08:00
Christopher Jeffrey
e5a82c7195 sighash. tx signing. testnet. 2016-01-15 15:53:57 -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
6b10fabc5f tx refactor. etc. 2016-01-08 19:27:00 -08:00
Christopher Jeffrey
8087601a7f work 2016-01-08 16:59:03 -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
42fbef82ed misc 2016-01-07 03:28:58 -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
ee97c7ed12 handle chain forks better. 2016-01-06 00:14:51 -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
ff08f73fa9 check orphan size. misc. 2016-01-05 03:25:53 -08:00
Christopher Jeffrey
60e01b261c rename fullchain.js to chain.js. 2016-01-05 02:48:53 -08:00
Christopher Jeffrey
32220fcc4f remove old spv chain. 2016-01-05 02:48:17 -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
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
d0cbc8f358 do not push unknown hash onto locators. 2016-01-04 13:39:40 -08:00
Christopher Jeffrey
20f8c82c7f add tip event to chain. 2016-01-04 04:59:55 -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
bdc546edbc fix chain.index.lastTs. 2016-01-02 05:09:44 -08:00
Christopher Jeffrey
a7a8eb11bb add orphanRoot to spv chain. 2016-01-02 05:04:10 -08:00
Christopher Jeffrey
fc45025131 add chain.compact. orphan failsafe. 2016-01-02 04:48:20 -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
0e5d7c41f2 refactor chain.has. 2016-01-01 19:54:22 -08:00
Christopher Jeffrey
1be3a74c70 more chain method improvements. 2016-01-01 18:46:46 -08:00
Christopher Jeffrey
a4084d8252 more chain methods. 2016-01-01 18:32:15 -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
146e50dc68 add fullnode chain. improve pool. 2016-01-01 17:41:13 -08:00
Christopher Jeffrey
d3e4dfaf5c fix some getters. move getInputData and getOutputData. wallet.toAddress. 2015-12-22 06:21:01 -08:00
Christopher Jeffrey
68c16b214a add rblock and rhash helpers. 2015-12-22 02:15:33 -08:00
Christopher Jeffrey
52b653083c add features potentially useful for blockchain explorers. 2015-12-21 20:00:13 -08:00
Christopher Jeffrey
61699cca3a style: function names. 2015-12-19 15:43:28 -08:00
Christopher Jeffrey
a96f27682f style. fix addr timestamp. 2015-12-19 02:17:01 -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
0bd4d798a9 fix locator hashes by height. 2015-12-18 17:38:59 -08:00
Christopher Jeffrey
7cabdcfda5 fix getOrphanRoot and usage. 2015-12-18 17:31:45 -08:00
Christopher Jeffrey
d1f8e9b5ff add chain.hasOrphan method. 2015-12-18 16:58:26 -08:00
Christopher Jeffrey
34e90c6baa handle chain forks from checkpoints. enforce one syncPeer. 2015-12-18 16:30:58 -08:00
Christopher Jeffrey
82983af52b pool wallets. chain errors. checkpoint failure. 2015-12-18 12:10:39 -08:00
Christopher Jeffrey
88ddb3620c get blockchain sync working. fix pushdata ops. 2015-12-17 16:05:48 -08:00
Christopher Jeffrey
ef1244442f check for network on fromJSON. 2015-12-09 16:32:01 -08:00
Christopher Jeffrey
57491aaadc add network.js and testnet support. see #40. 2015-12-09 16:25:55 -08:00
Christopher Jeffrey
89f2a0dcc3 formatting. make use of helpers in hd. 2015-12-09 10:40:33 -08:00
Christopher Jeffrey
db0da78ae5 only start calculating startHeight and locatorHashes after chain load. 2015-12-05 18:34:18 -08:00
Christopher Jeffrey
c96a12bf2e fix validateAddress. cleanup. 2015-12-05 04:59: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
a6584ae821 script: max length. chain: deadbeef fix. 2015-11-30 12:36:06 -08:00
Christopher Jeffrey
2b88192562 chain: fix fill percent. 2014-05-26 19:19:14 -05:00
Christopher Jeffrey
1b88b355ac chain: add a cacheLimit option to chain. 2014-05-26 12:53:47 -05: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
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
b041d3ae99 chain: misc fixes.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 18:09:40 +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
dfdc69aa3a lib: remove heavy modules 2014-05-11 14:27:05 +04:00
Fedor Indutny
8cd092dc2e lib: fix chain.isFull() 2014-05-10 23:35:22 +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
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
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
1d8574bdbd wallet: allow export/import without pub key 2014-05-08 13:50:11 +04:00