Commit Graph

4377 Commits

Author SHA1 Message Date
Christopher Jeffrey
5dce1427ba raw blocks. pool fixes. 2016-01-25 15:40:53 -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
e7d0ea81f9 block and tx methods. 2016-01-24 16:01:29 -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
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
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
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
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
704c95c90d add tx.getPriority and tx.isFree. 2016-01-20 12:31:47 -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
a2c08d9692 drop extra coinbase functions. 2016-01-20 00:21:41 -08:00
Christopher Jeffrey
486c22d0e7 get rid of getStartHeight. 2016-01-19 20:36:48 -08:00
Christopher Jeffrey
27fd056316 minor. 2016-01-19 20:35:26 -08:00
Christopher Jeffrey
c11a651e9d better loader management. 2016-01-19 20:32:59 -08:00
Christopher Jeffrey
8abaef49a9 check for nulldata in script extraction. 2016-01-19 17:15:27 -08:00
Christopher Jeffrey
5e00e42903 better nonstandard signing. 2016-01-19 16:12:30 -08:00
Christopher Jeffrey
1258cbbbd4 fix input/output calls. 2016-01-19 15:58:12 -08:00
Christopher Jeffrey
ebbb417283 more script data extraction improvements. 2016-01-19 15:53:00 -08:00
Christopher Jeffrey
b389dd1b5f better key and sig parsing for scripts. 2016-01-19 14:18:46 -08:00
Christopher Jeffrey
c8da41aa9d toJSON fixes. 2016-01-18 17:12:20 -08:00
Christopher Jeffrey
d2205241ee wallet key format. 2016-01-18 16:16:00 -08:00
Christopher Jeffrey
f5a63563e3 rename unspent. 2016-01-18 12:48:43 -08:00
Christopher Jeffrey
220b09bc67 fix unspent property. 2016-01-18 12:47:32 -08:00
Christopher Jeffrey
1d5e3ca27e add tx.setLockTime and tx.increaseFee (rbf). 2016-01-18 12:40:41 -08:00
Christopher Jeffrey
911f9534e4 fix testnet targetting. 2016-01-18 12:14:33 -08:00
Christopher Jeffrey
9011fcc25e stricter script standards. work on tx. 2016-01-18 01:52:18 -08:00
Christopher Jeffrey
6b36bad41d fix calls to isLowDER. 2016-01-17 21:23:19 -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
3745577837 standard opcodes. remove tx methods. 2016-01-17 15:52:09 -08:00
Christopher Jeffrey
6f4609792f regtest support. tx methods. 2016-01-16 23:48:18 -08:00
Christopher Jeffrey
b9041a0157 sign unknown txs. 2016-01-16 04:50:33 -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
46295b3c08 cleanup. misc. 2016-01-15 02:23:22 -08:00
Christopher Jeffrey
7854ec07d8 fix lockTime and changeIndex. 2016-01-14 18:16:49 -08:00
Christopher Jeffrey
05a8aeeb48 add bn2.js. 2016-01-14 16:09:18 -08:00
Christopher Jeffrey
0ba31eeb59 better script conformance. 2016-01-14 15:58:22 -08:00
Christopher Jeffrey
282639b5b1 script standardness. 2016-01-14 11:45:33 -08:00
Christopher Jeffrey
bfca638025 more packet improvements. 2016-01-14 01:59:33 -08:00
Christopher Jeffrey
077588e90a fix script.args. 2016-01-14 01:34:40 -08:00
Christopher Jeffrey
6154b1f7a1 improve tx verification. 2016-01-14 01:18:31 -08:00
Christopher Jeffrey
ef59dae1b5 simplify tbsHash. 2016-01-14 01:04:11 -08:00
Christopher Jeffrey
8f037ea430 tx: add tbsHash method. 2016-01-14 00:57:55 -08:00
Christopher Jeffrey
f8ec64d46f do not throw on empty stack. 2016-01-13 20:20:18 -08:00
Christopher Jeffrey
018d534c47 fix anyonecanpay. 2016-01-13 20:05:25 -08:00
Christopher Jeffrey
8ade973b31 sighash work 2016-01-13 19:41:03 -08:00
Christopher Jeffrey
397764ece6 input and output redeem script. 2016-01-13 18:40:51 -08:00
Christopher Jeffrey
4f8d24ba36 more int and packet work. 2016-01-13 18:31:07 -08:00
Christopher Jeffrey
5c1b136117 revert back to old output value writing. 2016-01-13 04:31:20 -08:00
Christopher Jeffrey
37803d178d use write64 for output values. 2016-01-13 04:15:14 -08:00
Christopher Jeffrey
10bd983899 version and addr packets. 2016-01-13 03:38:23 -08:00
Christopher Jeffrey
a71da261ad handle low S values in signatures. 2016-01-12 20:26:11 -08:00
Christopher Jeffrey
de455fa3e9 improve int functions and usage in parser and framer. 2016-01-12 18:13:32 -08:00
Christopher Jeffrey
c94457cf1f more tx refactoring. 2016-01-12 05:15:22 -08:00
Christopher Jeffrey
b147951a83 rename some variables. 2016-01-12 04:23:53 -08:00
Christopher Jeffrey
7b27f5dc9b hard fee calculation. 2016-01-12 04:08:25 -08:00
Christopher Jeffrey
3c8442b1bb improve fee calculation. 2016-01-12 03:47:12 -08:00
Christopher Jeffrey
ca03911d80 do not check for uncompressed keys for now. 2016-01-12 03:27:50 -08:00
Christopher Jeffrey
abc1f2b610 signInput should test against keys. 2016-01-12 02:55:35 -08:00
Christopher Jeffrey
645a3a59b2 minor. recover keys for isMultisig? 2016-01-12 02:08:07 -08:00
Christopher Jeffrey
fdc72b2062 let isMultisig handle m and n validation. 2016-01-12 01:13:22 -08:00
Christopher Jeffrey
f17f3b5bee pool: add startSync and stopSync. 2016-01-12 00:39:39 -08:00
Christopher Jeffrey
f420b41907 improve script.isMultisig. 2016-01-11 23:58:43 -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
b77314dd0f signature work. script function renames. add wallet.fillTX/tx.fill. 2016-01-11 15:20:44 -08:00
Christopher Jeffrey
6f86ca2d02 add utils.isBytes. 2016-01-11 01:07:05 -08:00
Christopher Jeffrey
1754e7ee77 fix for miner. 2016-01-11 00:56:27 -08:00
Christopher Jeffrey
9c2b0015d1 checkmultisig fixes. misc. 2016-01-11 00:40:16 -08:00
Christopher Jeffrey
cf5a117a3e fixes and improvements. allow arbitrary redeem scripts for wallet. 2016-01-11 00:10:31 -08:00
Christopher Jeffrey
442c984c12 improve p2sh building. change wallet key/redeem methods. 2016-01-10 21:43:52 -08:00
Christopher Jeffrey
871e36c426 tx.scriptOutput 2016-01-10 20:28:28 -08:00
Christopher Jeffrey
bf3906b4d4 more fee estimation. 2016-01-10 20:15:14 -08:00
Christopher Jeffrey
eb1a3ea6d2 transaction improvements. 2016-01-10 04:58:03 -08:00
Christopher Jeffrey
0b7ca266ee tx/script refactor and improvements. 2016-01-09 19:02:19 -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
e1ec89fe7d sigops 2016-01-06 01:41:06 -08:00
Christopher Jeffrey
6df8319871 fix pool peers. 2016-01-06 00:35:01 -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
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
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
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
74b1562a87 network: fix checkpoints. 2016-01-04 16:33:11 -08:00
Christopher Jeffrey
6da3fbac3a add utils.hash test. 2016-01-04 16:03:04 -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
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
eef4103296 miner: status event. 2016-01-04 05:07:53 -08:00
Christopher Jeffrey
61da977a3f miner: try to verify txs. 2016-01-04 05:03:24 -08:00
Christopher Jeffrey
20f8c82c7f add tip event to chain. 2016-01-04 04:59:55 -08:00
Christopher Jeffrey
0350b93a0a add a simple miner because we can. 2016-01-04 04:48:25 -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
3e5995f741 fix tx pool addition and tx verification. 2016-01-03 01:34:50 -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
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
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
e04aed96d0 remove throwing assert for now. 2016-01-01 23:54:48 -08:00
Christopher Jeffrey
440933c27d move pow target methods. 2016-01-01 19:58:35 -08:00
Christopher Jeffrey
0e5d7c41f2 refactor chain.has. 2016-01-01 19:54:22 -08:00
Christopher Jeffrey
5a26b7b71e add pow retargeting to full chain. 2016-01-01 19:53:57 -08:00
Christopher Jeffrey
8b546a85e0 check for fullNode in handleBlock and handleMerkle. 2016-01-01 19:14:34 -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
4c1a3761af set relay to false on spv. 2016-01-01 18:07:18 -08:00
Christopher Jeffrey
08320fd3fb update preload.js. 2016-01-01 17:58:54 -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
3625a4f4c9 minor fixes. 2015-12-30 14:34:16 -08:00
Christopher Jeffrey
350ca9c875 move all block sync logic to pool. 2015-12-29 18:40:31 -08:00
Christopher Jeffrey
22427fe78f stop saving block height on blocks. 2015-12-29 18:35:30 -08:00
Christopher Jeffrey
67d1405c15 handle compact mantissa numbers. 2015-12-29 13:13:51 -08:00
Christopher Jeffrey
43b0533a18 minor improvements and fixes. 2015-12-27 23:54:53 -08:00
Christopher Jeffrey
afcb89f76f block and tx getters. coinbase height. multisig input test. 2015-12-24 13:19:29 -08:00
Christopher Jeffrey
1f8bf8c377 input and output getters. 2015-12-24 12:18:00 -08:00
Christopher Jeffrey
6ceeb6800b remove useless line. 2015-12-24 03:27:34 -08:00
Christopher Jeffrey
42d872b268 calculate block reward. 2015-12-24 00:34:31 -08:00
Christopher Jeffrey
1fb6cb04b4 clean up input and output schema. 2015-12-23 23:44:59 -08:00
Christopher Jeffrey
207d9e1a30 refactor input and output data. 2015-12-23 23:12:54 -08:00
Christopher Jeffrey
0ccf67aef6 more input and output data work. 2015-12-23 21:55:25 -08:00
Christopher Jeffrey
cf9e11e356 add ids to inputs and outputs without addresses. 2015-12-23 20:09:14 -08:00
Christopher Jeffrey
f3ae1c517a send block and merkleblock packets correctly. 2015-12-23 19:56:33 -08:00
Christopher Jeffrey
b77c34789e refactor getData for inputs and outputs. 2015-12-23 19:55:27 -08:00
Christopher Jeffrey
b14c4daee0 refactor tx.utxos(). 2015-12-23 18:31:31 -08:00
Christopher Jeffrey
389ee296b0 improve tx building. minor style fixes. utils.uniq. 2015-12-23 16:24:29 -08:00
Christopher Jeffrey
d32a951f37 fix isMultisig: compare to n value. 2015-12-23 11:45:43 -08:00
Christopher Jeffrey
2299ee757e minor refactor. 2015-12-23 11:35:57 -08:00
Christopher Jeffrey
dddd6b0b49 minor: inspect methods. 2015-12-23 05:45:33 -08:00
Christopher Jeffrey
f68750991d add block.reward. add coinbase data to into. failsafe for getFee. 2015-12-23 05:33:48 -08:00
Christopher Jeffrey
fdc11b76b2 start checking for height coinbases earlier. 2015-12-23 04:44:21 -08:00
Christopher Jeffrey
58d8e3ce53 fix coinbase parsing. 2015-12-23 04:14:51 -08:00
Christopher Jeffrey
2f6f3e11b1 Revert "use big numbers when calculating fee."
This reverts commit a057dc4064.
2015-12-23 02:42:57 -08:00
Christopher Jeffrey
a057dc4064 use big numbers when calculating fee. 2015-12-23 02:42:36 -08:00
Christopher Jeffrey
d54a532a66 fix error thrown in output.inspect. 2015-12-23 02:35:32 -08:00
Christopher Jeffrey
b3f457ee31 improve locktime checks and coinbase parsing. 2015-12-23 02:34:51 -08:00
Christopher Jeffrey
4ac398e41b add tx to prev output data. 2015-12-22 22:50:13 -08:00
Christopher Jeffrey
47618898c7 minor. 2015-12-22 20:11:09 -08:00
Christopher Jeffrey
3d417f48df improve coinbase height check. 2015-12-22 20:07:20 -08:00
Christopher Jeffrey
618177b6a6 grab block height from the coinbase script. 2015-12-22 19:30:32 -08:00
Christopher Jeffrey
07a1322749 inspect methods. better data parsing. expose modules. 2015-12-22 19:27:36 -08:00
Christopher Jeffrey
b522aa2b06 handle merkleblock vs block better. 2015-12-22 15:03:17 -08:00
Christopher Jeffrey
1c8604477f improve script type tests. improve input/output data. 2015-12-22 14:50:07 -08:00
Christopher Jeffrey
b16a86b2d4 fix typo. 2015-12-22 06:50:09 -08:00
Christopher Jeffrey
d3e4dfaf5c fix some getters. move getInputData and getOutputData. wallet.toAddress. 2015-12-22 06:21:01 -08:00
Christopher Jeffrey
a17fe6fe5f use dynamic input and output objects. 2015-12-22 05:00:55 -08:00
Christopher Jeffrey
a91f245e86 add types to data. aliases for utils. 2015-12-22 04:03:15 -08:00
Christopher Jeffrey
eb6a9fc20d make data easier to extract from inputs and outputs. 2015-12-22 03:22:49 -08:00
Christopher Jeffrey
a6e3024e9b peer address and port. 2015-12-22 03:19:27 -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
a7ea69f48a improve utils: primarily toBTC and fromBTC. 2015-12-21 15:20:01 -08:00
Christopher Jeffrey
500f079632 fix script arithmetic, op_verify, and wallet.fillUnspent. 2015-12-21 11:26:13 -08:00
Christopher Jeffrey
d28716c98d use regular addresses for wallet prefix. 2015-12-20 19:35:56 -08:00
Christopher Jeffrey
87d4d4b0ad refactor script and wallet. better redeem script error. 2015-12-20 16:08:00 -08:00
Christopher Jeffrey
c0d0423f14 hd/wallet: minor. 2015-12-20 13:29:39 -08:00
Christopher Jeffrey
b900d706c0 move varint and readIntv to utils. 2015-12-20 02:01:19 -08:00
Christopher Jeffrey
f25d69f30f put user agent in constants. 2015-12-20 01:57:47 -08:00
Christopher Jeffrey
93e42e90a1 drop old fee and dust constants. style. 2015-12-20 01:50:18 -08:00
Christopher Jeffrey
a50ee3e0ba remove wallet.getPublicKeys(). 2015-12-20 01:45:17 -08:00
Christopher Jeffrey
1db84a0528 wallet json and prefix. style. cleanup. 2015-12-20 01:43:09 -08:00
Christopher Jeffrey
61699cca3a style: function names. 2015-12-19 15:43:28 -08:00
Christopher Jeffrey
0aff6d7cfe improve script.isValidSig. 2015-12-19 15:26:26 -08:00
Christopher Jeffrey
2e7892c798 use keyPair() in script.verify. whitespace. 2015-12-19 15:24:19 -08:00
Christopher Jeffrey
a18a501c37 refactor hd keys. 2015-12-19 15:14:56 -08:00
Christopher Jeffrey
b20bcf701b fix private key encryption. style changes. 2015-12-19 14:00:23 -08:00
Christopher Jeffrey
75afb6d953 fix utils.toBTC 2015-12-19 02:57:01 -08:00
Christopher Jeffrey
cb2bcc21c6 prevent buffered _writes from binding thousands of events. 2015-12-19 02:52:51 -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
1a6633bade style consistency - again. 2015-12-19 02:05:46 -08:00
Christopher Jeffrey
6411ec8914 fix p2sh multisig verification. 2015-12-19 01:43:34 -08:00
Christopher Jeffrey
7cae4c4eb5 remove uint8array check for now. minor style. 2015-12-18 22:57:39 -08:00
Christopher Jeffrey
8746248c2c addr packet parsing. 2015-12-18 22:55:06 -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
283157dd71 add allowEval option. 2015-12-18 17:56:06 -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
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
4984c306b9 minor: function name. 2015-12-18 15:44:15 -08:00
Christopher Jeffrey
6ae273f84d tx.verify: compare top stack item against zero instead of one. 2015-12-18 15:43:17 -08:00
Christopher Jeffrey
5942209f41 pass size into block and tx for maxsize checks. 2015-12-18 15:41:34 -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
5791672c07 pass _network to tx. script debugging. tx filled total. 2015-12-18 13:01:23 -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
135208910d always set nSequence to zero when nLockTime is present. 2015-12-17 18:33:27 -08:00
Christopher Jeffrey
1e0a153b59 do not overwrite lockTime input by user. 2015-12-17 17:58:09 -08:00
Christopher Jeffrey
7f70b573c1 enforce checklocktimeverify for nLockTime when adding input. tx.prevOut method. 2015-12-17 17:56:46 -08:00
Christopher Jeffrey
aac4911b4e remove comments for pushdata issue. 2015-12-17 17:39:08 -08:00
Christopher Jeffrey
f89908bb65 script formatting 2015-12-17 17:37:13 -08:00
Christopher Jeffrey
3e747f0df4 comment 2015-12-17 17:33:02 -08:00
Christopher Jeffrey
5b68ec0b3e add option for colored coin output creation. 2015-12-17 17:31:37 -08:00
Christopher Jeffrey
efe1181bc1 move key sorting to utils. 2015-12-17 17:23:33 -08:00
Christopher Jeffrey
b74e8de067 input tests. function names. getInputKey/getOutputKey. 2015-12-17 17:14:41 -08:00
Christopher Jeffrey
6abfc10a28 improve input checks with keys/hashes/redeemscript. 2015-12-17 16:53:35 -08:00
Christopher Jeffrey
6caa6b91dd add spendable checking for checklocktimeverify. 2015-12-17 16:06:08 -08:00
Christopher Jeffrey
5e89aedf0b improve input testing. 2015-12-17 16:06:08 -08:00
Christopher Jeffrey
0c8168c697 rename colored coin check. all input script tests. 2015-12-17 16:06:08 -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
5e5507f668 optimize checkmultisig. 2015-12-15 01:48:21 -08:00
Christopher Jeffrey
c44ea0090f implement sighash_single bug. 2015-12-15 01:41:44 -08:00
Christopher Jeffrey
1b07d6e906 minor cleanup. 2015-12-15 01:23:49 -08:00
Christopher Jeffrey
c68ab4ee7d implement all sighash types. add hasUnspent(). 2015-12-15 01:22:24 -08:00
Christopher Jeffrey
b0a3a0e853 utils. minor fixes. wallet functions. 2015-12-14 14:00:06 -08:00
Christopher Jeffrey
5c1606985a outputScript() consistency. 2015-12-10 18:02:47 -08:00
Christopher Jeffrey
1caa0804d9 add getKey functions to TX. 2015-12-10 17:54:34 -08:00
Christopher Jeffrey
bb9974b818 add master key reference to hd keys. 2015-12-10 17:54:15 -08:00
Christopher Jeffrey
243d3fd69f fill checkmultisig scripts with 0s if not enough keys are available. add format function. 2015-12-10 17:53:42 -08:00
Christopher Jeffrey
c251def27c wallet: multisig key handling. prefixes. to/fromJSON. 2015-12-10 17:45:56 -08:00
Christopher Jeffrey
d7eea0941e add less-than-dust to fee. recalculate fee after input scripts are templated. 2015-12-10 13:52:34 -08:00
Christopher Jeffrey
3f44538b46 remove commented code. error consistency. 2015-12-10 02:28:57 -08:00
Christopher Jeffrey
3dec18c2c7 wallet/tx/script: n limit. refactor multisig options. 2015-12-10 02:25:44 -08:00
Christopher Jeffrey
14f08e891c improve toBTC and fromBTC while ensuring safety. 2015-12-09 17:31:45 -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
26035c3b41 minor fix for disabled op_eval. 2015-12-09 14:40:40 -08:00
Christopher Jeffrey
f9186d785a ensure p2sh inputs have only push ops (do the same for raw multisig?). 2015-12-09 14:35:47 -08:00
Christopher Jeffrey
72d9a93773 fix and test if statements. fix comparisons. 2015-12-09 14:35:23 -08:00
Christopher Jeffrey
690fe7163a better handling of [] when it is OP_0. 2015-12-09 12:42:45 -08:00
Christopher Jeffrey
2fd1d171f2 handle op_1negate. 2015-12-09 12:15:02 -08:00
Christopher Jeffrey
79a594716a reorder opcode handlers. move op_eval (disabled). 2015-12-09 12:02:39 -08:00
Christopher Jeffrey
d45350ede9 refactor script.execute order of opcodes. 2015-12-09 12:00:35 -08:00
Christopher Jeffrey
e605fe5388 whitespace. 2015-12-09 11:57:54 -08:00
Christopher Jeffrey
2412c0999b potential tx.verify fix. 2015-12-09 11:56:08 -08:00
Christopher Jeffrey
a0a391e89e add if/notif/else/endif opcodes. 2015-12-09 11:55:05 -08:00
Christopher Jeffrey
d1ac6e914d refactor script.execute. 2015-12-09 10:57:18 -08:00
Christopher Jeffrey
c869578009 script: cleanup. 2015-12-09 10:44:44 -08:00
Christopher Jeffrey
89f2a0dcc3 formatting. make use of helpers in hd. 2015-12-09 10:40:33 -08:00
Christopher Jeffrey
8a33f2efa1 add getFullPublicKey/getOwnPublicKey and use appropriately. 2015-12-08 19:42:12 -08:00
Christopher Jeffrey
71ea61e467 update elliptic. remove ec.curve.n workaround. 2015-12-08 17:34:36 -08:00
Christopher Jeffrey
22e092d6b8 fix and test hd keys. 2015-12-08 16:36:47 -08:00
Christopher Jeffrey
e4cfa878f1 multisig options. 2015-12-08 15:02:32 -08:00
Christopher Jeffrey
5f8ad78e4d have tx.verify handle p2sh correctly. 2015-12-08 14:54:21 -08:00
Christopher Jeffrey
a9a9cf0879 add more opcodes to script.execute. handle codesep properly. 2015-12-08 14:06:10 -08:00
Christopher Jeffrey
fd7d20be9c enforce strict ordering with checkmultisig. 2015-12-08 11:46:14 -08:00
Christopher Jeffrey
3c0bf360e2 add bip66 strict der sig checking. 2015-12-08 11:35:42 -08:00
Christopher Jeffrey
adbb0099a1 add checklocktimeverify. pass in tx and input to execute() instead of using hasher callback. 2015-12-08 11:24:22 -08:00
Christopher Jeffrey
7016991366 order keys and signatures for multisig correctly. 2015-12-07 19:18:37 -08:00
Christopher Jeffrey
77623bb8d6 remove useless code. 2015-12-07 16:34:44 -08:00
Christopher Jeffrey
58d8881e46 add hd tests. 2015-12-07 16:17:09 -08:00
Christopher Jeffrey
a1fea2bd65 scriptOutput: move "p2shify". 2015-12-07 15:55:31 -08:00
Christopher Jeffrey
37e1c8a2ef formatting changes. 2015-12-07 15:51:15 -08:00
Christopher Jeffrey
b1e7cde3dd improve script functionality and usage. 2015-12-07 15:39:18 -08:00
Christopher Jeffrey
cf20326e98 verify sighash types other than all. 2015-12-07 14:22:25 -08:00
Christopher Jeffrey
1804acc77c tests passing. 2015-12-07 14:02:25 -08:00
Christopher Jeffrey
3d9d6be23c use this.m for nsigs. 2015-12-07 11:04:23 -08:00
Christopher Jeffrey
9241a6660e remove old wallet.fill and wallet.sign. 2015-12-07 11:02:50 -08:00
Christopher Jeffrey
d7bc48fc2e move wallet.fill to tx object. 2015-12-07 11:00:58 -08:00
Christopher Jeffrey
ae394fad11 improve tx.maxSize for p2sh and multisig. 2015-12-05 20:54:18 -08:00
Christopher Jeffrey
6295642f20 remove useless if statement. 2015-12-05 20:23:33 -08:00
Christopher Jeffrey
4f76b9f18c fix scriptInput/signInput for multisig/p2sh. 2015-12-05 19:02:44 -08:00
Christopher Jeffrey
db0da78ae5 only start calculating startHeight and locatorHashes after chain load. 2015-12-05 18:34:18 -08:00
Christopher Jeffrey
3f2d53b414 hd.js: workaround for latest bn.js. 2015-12-05 18:19:52 -08:00
Christopher Jeffrey
c96a12bf2e fix validateAddress. cleanup. 2015-12-05 04:59:18 -08:00
Christopher Jeffrey
46a5ca7500 minor fix for wallet.fill. 2015-12-05 04:18:21 -08:00
Christopher Jeffrey
916fca9c2f update hash.js. use for sha512-hmacs. 2015-12-05 04:16:41 -08:00
Christopher Jeffrey
40fca0dda8 remove noSign and getChange for now. 2015-12-05 03:55:08 -08:00
Christopher Jeffrey
a2f13d94c3 fix address problems. update elliptic to 3.0.3. 2015-12-05 03:40:11 -08:00
Christopher Jeffrey
505aad8729 improve/fix p2sh. move input signing functionality to tx object. 2015-12-05 03:01:37 -08:00
Christopher Jeffrey
377e156874 fix m, n, publicKeys in wallet constructor. 2015-12-05 01:03:51 -08:00
Christopher Jeffrey
1e10b83acf fix redeem script push in wallet. 2015-12-05 00:50:19 -08:00
Christopher Jeffrey
1d210589c5 comments explaining signing logic. 2015-12-05 00:02:23 -08:00
Christopher Jeffrey
acbe4d0c2e remove wallet.signEmpty and tx.signature for now. 2015-12-05 00:01:59 -08:00
Christopher Jeffrey
c8e04d8552 comments 2015-12-04 23:16:02 -08:00
Christopher Jeffrey
87eea1e398 fixes and minor style changes 2015-12-04 22:50:13 -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
Stanislas Marion
b76f33047e script: .isScripthash(s)/.isNullData(s) 2014-12-19 08:04:07 +07:00
Stanislas Marion
70608ae2a3 parser: put the exact raw data in tx._raw 2014-11-25 18:44:45 +03:00
Stanislas Marion
7655ad12c7 script: encode/decode op1-16 as single numbers
fix #33
2014-11-17 15:06:37 +03:00
Christopher Jeffrey
4e7dbae829 fix: minor fixes to block framer and block. 2014-06-24 01:08:44 -05:00
Christopher Jeffrey
73ea21a903 minor: style - move block json functions to bottom of the file. 2014-06-24 00:59:39 -05:00
Christopher Jeffrey
5e3e72ba4c minor: more style concerns. 2014-06-24 00:57:46 -05:00
Christopher Jeffrey
6072fe7afd minor: remove commented code. style concerns. 2014-06-24 00:45:18 -05:00
Christopher Jeffrey
c6bafbcb48 fix: ensure user agent is less than 0xfd in length. we can assume the varint is 1 byte. 2014-06-24 00:43:37 -05:00
Christopher Jeffrey
6a03b30ddf fix: allow ownOutputs as orphans - fixes failing test. see #27. 2014-06-16 22:46:58 -05:00
Christopher Jeffrey
2e14fe1780 fix tx-pool unspent output handling. fixes #26. 2014-06-16 18:55:04 -05:00
Christopher Jeffrey
3a7b20ddee minor: if statement style. 2014-06-12 17:09:57 -05:00
Christopher Jeffrey
9442920e73 wallet: improve ownInput and ownOutput. 2014-06-12 02:55:53 -05:00
Christopher Jeffrey
dbd3b5025a tx-pool: handle noWrite better. update tx.block along with tx.ts. 2014-06-11 18:45:34 -05: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
7b928f079c utils: improve nextTick. 2014-06-06 16:23:26 -05:00
Christopher Jeffrey
eadb7a50c7 pool: add version and peer events for peers. 2014-06-06 16:20:50 -05:00
Christopher Jeffrey
005c11e967 parser: fix version parsing. check user agent in tests. 2014-06-06 15:47:29 -05:00
Christopher Jeffrey
ac8905bf3d fix: wallet.sign return value. 2014-06-06 14:54:02 -05:00
Christopher Jeffrey
ac60920f98 fix: keep track of the input index better for subscript hashing. 2014-06-06 12:29:36 -05:00
Christopher Jeffrey
11b56e32d7 fix: do not throw on destroyed peers. 2014-06-06 06:37:47 -05:00
Christopher Jeffrey
28abd09845 wallet: allow inputs and offset to be passed into wallet.sign. 2014-06-06 03:10:21 -05:00
Christopher Jeffrey
5a67c56b00 Merge pull request #23 from chjj/block-size
parser: fix minimum block size.
2014-06-03 09:56:56 -05:00
Christopher Jeffrey
4dd8a54501 framer: another style fix. 2014-06-03 09:46:19 -05:00
Christopher Jeffrey
841bf86d7d block: fix for style conventions. 2014-06-03 09:45:53 -05:00
Christopher Jeffrey
566b2e9916 parser: fix minimum block size. 2014-06-02 03:14:44 -05:00
Christopher Jeffrey
8d6c438e3d pool: stop throwing uncatchable errors on parser errors. 2014-06-02 02:29:15 -05:00
Christopher Jeffrey
2b88192562 chain: fix fill percent. 2014-05-26 19:19:14 -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
a3b923ae76 peer: have updateWatch getblocks instead of filterload for the satoshi option. 2014-05-26 05:12:56 -05:00
Christopher Jeffrey
024350dbe4 peer/pool: improve handleInv. improve addPeer. 2014-05-26 04:03:23 -05:00
Christopher Jeffrey
6d2c1bd9f1 framer: fix undefined var typo. 2014-05-25 08:02:33 -05:00
Christopher Jeffrey
8546cc7e33 block: fix timestamp check...again. 2014-05-24 18:06:52 -05:00
Christopher Jeffrey
1052b7361c block: fix timestamp check in checkBlock. 2014-05-24 18:05:31 -05:00
Christopher Jeffrey
c1fbab35e1 block: remove some unused code from checkBlock. 2014-05-24 13:44:10 -05:00
Christopher Jeffrey
9dc0063ea9 test/parser: add version test for height and relay / fix typo. 2014-05-24 02:16:59 -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
2d7599d2d3 block: use utils.dsha256 instead of hash.js for merkle tree building. 2014-05-24 01:19:32 -05:00
Christopher Jeffrey
60a9e556f8 framer: frame regular blocks with transactions correctly. 2014-05-23 23:27:54 -05:00
Christopher Jeffrey
e3e324441b block: improve performance of duplicate tx check. 2014-05-23 23:13:16 -05:00
Christopher Jeffrey
44774e7c6b block: follow the behavior of bitcoind's CheckBlock(). 2014-05-23 23:12:46 -05:00
Christopher Jeffrey
e66f2f50bf block: build merkleTree to verify merkleRoot on regular blocks. 2014-05-23 23:08: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
faca3454b2 framer: fix array length, assuming user-agent is below 0xfd in length.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-23 14:39:51 +04:00
Christopher Jeffrey
9981835df4 framer: includer user-agent in version packet.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-23 14:35:22 +04:00
Christopher Jeffrey
793fed1974 framer: refactor.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:20 +04:00
Christopher Jeffrey
44fab2b58a peer: handle address timestamp better.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:20 +04:00
Christopher Jeffrey
a0c2f66169 peer: fix handleGetAddr. fix addr test.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-20 13:36:20 +04:00
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