Braydon Fuller
06ef0e3615
indexer: simplify addrindex query
2019-05-15 12:11:05 -07:00
Braydon Fuller
ebc40a58d0
indexer: trim disk usage for tx and addr indexes
2019-05-15 12:11:01 -07:00
Braydon Fuller
93c6ff845e
indexer: fix, simplify and rewrite indexer base
...
- Write indexer state and index atomically.
- Simplify chain state with current height.
- Roll forward to best height.
- Synchronize the index with the chain with common method `sync` for
the events 'connect', 'disconnect' and 'reset'. This will prevent
any of the events from conflicting with each other.
- Fix the chain rollback and reset.
- Make sure blocks are connected in the correct order.
- Improve logging to log similar to chain.
2019-05-15 12:02:50 -07:00
Javed Khan
e2a6a92ebc
addrindexer: index by address prefix
2019-05-15 12:02:50 -07:00
Javed Khan
9f86dbca28
chaindb: bump to v6
2019-05-15 12:02:49 -07:00
Braydon Fuller
7dc55c9c3c
indexer: remove address coin index
2019-05-15 12:02:48 -07:00
Braydon Fuller
05d55efb22
indexer: fix memory and cpu exhaustion for addrindex
2019-05-15 12:02:48 -07:00
Braydon Fuller
8bff122253
indexer: use chain and blocks for indexer, remove chain client
2019-05-15 12:02:47 -07:00
Braydon Fuller
f9aab08c46
indexer: add block position to tx
2019-05-15 12:02:47 -07:00
Javed Khan
9f89c79bd7
indexer: work with blockstore
2019-05-15 12:02:47 -07:00
Javed Khan
05794f5cb3
indexer: add module indexer
...
module indexer introduces a extensible architecture for indexing the
chain. It provides a base class which handles syncing with the chain,
handling re-orgs, interruptions, dynamic toggling, etc. TXIndexer
and AddrIndexer are provided for indexing transactions and addresses,
using the same flags as before i.e --index-tx and --index-address.
Indexes are stored in a different database and can be maintained
independently of the chain.
2019-05-15 12:02:41 -07:00
Braydon Fuller
81b840a634
Merge pull request #769 from braydonf/wallet-tx-conflict
...
wallet: handle multiple conflicting inputs
2019-05-14 22:56:29 -07:00
Braydon Fuller
eba7bbeddc
wallet: handle multiple conflicting inputs
2019-05-14 14:29:41 -07:00
Orfeas Stefanos Thyfronitis Litos
07f7338503
Replace 285 with 293 in blockstore README ( #767 )
...
* Replace 285 with 293 in blockstore README
* Mention block size after boundaries
2019-05-12 17:55:48 +05:30
Javed Khan
4bc0bb2366
chain: add fee overflow test; rename error
2019-05-07 03:27:42 +05:30
Javed Khan
812dc1a6f3
Merge pull request #764 from braydonf/checkpoint
...
blockchain: do not accept forked chain older than last checkpoint
2019-05-07 00:23:19 +05:30
Braydon Fuller
b68207610c
blockchain: do not accept forked chain older than last checkpoint
...
This has been patched in both bitcoind and btcd around February 20th, 2014. It was
shortly followed by a headers-first synchronization of blocks.
- d8b4b49667
- 50b6e10b57
2019-05-02 14:44:10 -07:00
kilpatty
d5514d9dcb
node-http: add check for height being below tip
...
This commit simply adds an enforce line to check that the height being
requested to reset to is below the chain tip. This way we return a bad
request error rather than a internal server error.
2019-04-30 21:43:48 -05:00
Braydon Fuller
50fe51ca32
blockstore: close file if write or read throws
2019-04-08 13:26:16 -07:00
Braydon Fuller
3457ccc91b
blockchain: remove blocks after commit
2019-04-08 13:24:54 -07:00
Braydon Fuller
83824d73b1
blockstore: optimize block read and index
...
There is potential for around a 10% to 23% increase to the performance
of block reads by using `allocUnsafe`, however there is already around
a 3 to 6 times increase to the performance. While it's safe to use
`allocUnsafe` as the number of bytes read is checked to be the same
size as the buffer allocation, there is a potential for test cases
to introduce _other_ behavior for `fs.read` that may not have the
same behavior, though this isn't currently the case.
2019-04-08 13:20:00 -07:00
Braydon Fuller
41ce504175
bcoin: expose blockstore module
2019-04-08 13:18:59 -07:00
Braydon Fuller
f3e517c3c0
blockstore: fix logger, improve messages
2019-04-08 13:18:58 -07:00
Javed Khan
6af6353906
blockstore: add README and docs
2019-04-08 13:18:58 -07:00
Braydon Fuller
961f6eddb5
blockstore: index undo blocks from files
2019-04-08 13:18:57 -07:00
Braydon Fuller
8fc605c4a9
blockstore: index after write interrupt and use less memory
2019-04-08 13:18:57 -07:00
Braydon Fuller
5cbbcf5409
blockstore: do not write block twice
2019-04-08 13:18:57 -07:00
Braydon Fuller
747a8e707b
blockstore: tests and fixes for blockstore error cases
2019-04-08 13:18:56 -07:00
Braydon Fuller
0f0cb00c54
blockstore: minor, spelling
2019-04-08 13:18:56 -07:00
Braydon Fuller
bdcb392a9c
blockchain: do not check blockstore with spv
2019-04-08 13:18:56 -07:00
Braydon Fuller
d1e747cf2f
blockstore: minor, update comments and docs
2019-04-08 13:18:55 -07:00
Braydon Fuller
8b6ec89a64
blockchain: use blockstore for undo coins
2019-04-08 13:18:55 -07:00
Braydon Fuller
89d3253f29
blockstore: add ensure method to create directories
2019-04-08 13:18:54 -07:00
Braydon Fuller
0b0dd58a91
node: add blockstore to full node
2019-04-08 13:18:54 -07:00
Braydon Fuller
11af5456ce
blockstore: additional options and create function
2019-04-08 13:18:54 -07:00
Javed Khan
6be21203af
blockchain: integrate blockstore into chaindb
2019-04-08 13:18:53 -07:00
Braydon Fuller
3cec13ef5e
blockstore: add block data types with an undo type
2019-04-08 13:18:53 -07:00
Braydon Fuller
abd2ae4b5d
blockstore: prevent blocks writes at the same position
2019-04-08 13:18:53 -07:00
Braydon Fuller
2d08b296f7
blockstore: recover from block write interrupt
2019-04-08 13:18:52 -07:00
Braydon Fuller
620f21d6f5
blockstore: await for level block store writes
2019-04-08 13:18:52 -07:00
Braydon Fuller
8435a116f1
blockstore: add file block storage
2019-04-08 13:18:47 -07:00
Braydon Fuller
392b3836fc
Merge pull request #715 from pinheadmz/inspect
...
Use custom `inspect` for all objects to avoid deprecation warning
2019-04-05 09:41:24 -07:00
Braydon Fuller
7136c256fc
Merge pull request #745 from pinheadmz/hashstring
...
util: reverse buffers instead of strings
2019-04-05 08:36:47 -07:00
Matthew Zipkin
1b868b6a9d
util: reverse buffers instead of strings
2019-04-02 16:53:46 -07:00
Braydon Fuller
7ceb8874ee
Merge pull request #736 from braydonf/coin-cache
...
Remove coin cache
2019-04-02 15:24:07 -07:00
Javed Khan
6a01409b79
Merge pull request #739 from pinheadmz/scan
...
node-http: require Bloom filter is loaded for `rescan` socket call
2019-04-02 18:55:53 +05:30
Matthew Zipkin
83639f151c
util: fallback for inspect
2019-03-27 07:36:22 -04:00
Mark Tyneway
a28ffa272a
wallet rpc: add getaddressinfo rpc command
...
update the rpc command to better match bitcoind.
add the ismine and iswatchonly fields and
segwit related fields such as witness_version
and witness_program.
2019-03-26 16:13:18 -07:00
Mark Tyneway
26a2000b01
node rpc: update validateaddress
...
updates validateaddress to match the changes
in bitcoind https://github.com/bitcoin/bitcoin/pull/10583 .
removes the fields ismine and iswatchonly, those
are things that a wallet would know, not a node.
adds segwit related fields, witness_version and
witness_program. test changes to the node rpc method
validateaddress with p2pkh, p2sh, p2wpkh and p2wsh addresses
2019-03-26 16:03:23 -07:00
Matthew Zipkin
11d70432b3
node-http: require filter to scan
2019-03-26 10:17:10 -07:00
Braydon Fuller
a9ebeb3871
blockchain: remove coin cache
2019-03-21 15:15:51 -07:00
Matthew Zipkin
5751b8c330
rpc: multiple fixes and tests
...
wallet-rpc: fix listsinceblock height
wdb: fix getWalletPaths() always return nothing
wallet: add unlockCoins() for lockunspent rpc
wallet-rpc: correct num args for some rpc calls
wallet-rpc: fix args for importwallet and importprunedfunds
wallet-rpc: importprunedfunds error misleading
wallet-rpc: importPubkey args
wallet-rpc: listsinceblock arg count error
wallet-rpc: listTransactions ignoring account param
wallet-rpc: better sendMany error msgs
wallet-rpc: sendMany subtractfee is bool not obj
wallet-rpc: dont check if not implemented
test: add rpc-test
2019-03-11 14:36:13 -07:00
Matthew Zipkin
df4e287817
utils: custom inspect for objects
2019-03-11 14:28:45 -07:00
Nodar Chkuaselidze
c0fb984da6
wallet: create non-templated transaction.
2019-03-05 21:14:25 +04:00
Braydon Fuller
c1f5975fb1
Merge pull request #705 from rsbondi/rpc-help
...
rpc help list commands
2019-03-04 11:12:33 -08:00
Richard Bondi
9aebfb74e0
rpc help list commands
2019-03-02 11:38:38 -06:00
Matthew Zipkin
a2bf18ff18
wallet: better wallet.send outputs error
2019-03-01 10:45:05 -08:00
Sky Young
00850e5e84
Increase maximum ancestor count to 1250
2019-02-27 11:17:59 -08:00
Braydon Fuller
ea1c6becb5
Merge pull request #700 pinheadmz/blockjson
...
block: inspect() expects buffer from getCommitmentHash()
2019-02-22 18:20:01 -08:00
Matthew Zipkin
67a258ea74
block: get wit-commit as buffer
2019-02-22 18:08:22 -08:00
bitspill
2da47b5531
swap priority of script hash prefixes
...
default to using `e`/`f` rather than `4` on P2SH addresses
example transaction https://livenet.flocha.in/tx/cfb1b7b0f57283a078c6cbd9bf7baf9f688b454814a3e4199f9508b901db40c6
2019-02-22 13:45:56 -08:00
Nodar Chkuaselidze
a9193f052f
mempool: fix malleability check in mempool
2019-02-14 19:56:51 +04:00
Matthew Zipkin
1696b3c7bb
wallet: require pubkey for watchonly
2019-02-11 14:14:33 -08:00
Javed Khan
7c64fd845c
Merge pull request #684 from braydonf/update-tests
...
Update transaction and script tests
2019-02-11 21:38:44 +05:30
Matthew Zipkin
bb1ce25449
wallet-http: create account: remove unused 'watch-only'
2019-02-08 16:26:51 -08:00
Braydon Fuller
35a25e0d8b
protocol: clear regtest seeds
...
This prevents attempts to add itself as a peer that would
generate unnecessary error log messages when running a regtest node.
2019-02-07 18:56:51 -08:00
Steven Bower
fe5a6d7eff
wallet: improve logging (minor)
2019-02-07 17:01:37 -08:00
Matthew Zipkin
f0806a54dd
rpc: remove handleError
2019-02-07 14:04:37 -08:00
Matthew Zipkin
7303d284d5
wallet-rpc: log queries
2019-02-07 14:04:37 -08:00
Matthew Zipkin
da2084f503
rpc: identify node/wallet in log
2019-02-07 14:04:37 -08:00
Matthew Zipkin
d9044960ad
http: identify node/wallet in log
2019-02-07 14:04:37 -08:00
Braydon Fuller
39684df605
Merge pull request #676 from tynes/update-regtest
...
Update Regtest Specific Params
2019-02-05 11:37:20 -08:00
Braydon Fuller
37fc9a78e4
script: update script tests and behavior
...
References:
- https://github.com/bitcoin/bitcoin/pull/12425
- https://github.com/bitcoin/bitcoin/pull/12167
- https://github.com/bitcoin/bitcoin/pull/10699
2019-02-01 16:32:39 -08:00
Braydon Fuller
efa78100e0
script: update tx standardness rules and more tx tests
...
References:
- https://github.com/bitcoin/bitcoin/pull/11423
- https://github.com/bitcoin/bitcoin/pull/12600
- https://github.com/bitcoin/bitcoin/pull/12082
Trivial References:
- https://github.com/bitcoin/bitcoin/pull/12393
- https://github.com/bitcoin/bitcoin/pull/6539
- https://github.com/bitcoin/bitcoin/pull/10742
- ecb11f561c
2019-02-01 16:32:31 -08:00
Javed Khan
3c1fda4826
pool: fix this.options.discover
2019-02-01 21:56:57 +05:30
Braydon Fuller
fa877503a4
blockchain: enable segwit for regtest
2019-01-31 13:03:59 -08:00
Javed Khan
127fea663f
pool: disable discover with only
2019-01-31 20:27:47 +05:30
Mark Tyneway
b10aea8f3d
bugfix: regtest segwit start time 0
...
The deployments are written to and read
from a database and the start time is
a U32. Changing the value to -1 will cause
the value to be read incorrectly and cause
the tests to fail.
2019-01-28 15:31:59 -08:00
Javed Khan
70886c33e2
networks: restore regtest ports
2019-01-28 15:31:59 -08:00
Javed Khan
53a09b0a02
networks: always activate segwit for regtest
2019-01-28 15:31:57 -08:00
Javed Khan
48f38a4a65
networks: update regtest params
2019-01-28 15:31:56 -08:00
Javed Khan
6f1a561db5
Merge pull request #641 from nodar-chkuaselidze/fix/mempool-index
...
mempool: reflect spent coins in mempool coinview.
2019-01-21 18:52:34 +05:30
Javed Khan
bd7a0949b6
Merge pull request #632 from nodar-chkuaselidze/fix/addresses
...
address minor fixes
2019-01-04 20:45:34 +05:30
Javed Khan
b0bf2ddd37
Merge pull request #648 from OrfeasLitos/get-keys-from-multisig
...
Implement and test KeyRing.fromMultisigScript(script, i)
2019-01-04 20:35:35 +05:30
Javed Khan
54cdd16723
Merge pull request #633 from pinheadmz/patch-4
...
net: add testnet seeds (for browser)
2019-01-01 18:35:52 +05:30
Orfeas Litos
6d48e41c96
Implement KeyRing.fromMultisigScript(script, i)
2018-12-09 22:11:44 +00:00
Christopher Jeffrey
0b70a940a3
test: get tests passing in chrome.
2018-12-08 02:40:49 -08:00
Nodar Chkuaselidze
32cba1bf4a
mempool: reflect spent coins in mempool coinview.
...
Currently coinview does not account for spent coins in the mempool,
This does not create problems because we have additional checks in
right places which detect double spends, but technically
coinview should help you detect double spent in the mempool as well.
This way it will be compatible with chain.getCoinView.
getSpentView will still return all outputs that are available
in the mempool. (This could also return spentView from indexers if
available, this method is used by `signrawtransaction`.)
2018-11-25 23:32:13 +04:00
Matthew Zipkin
8b6eba165b
net: add testnet seeds (for browser)
...
bcoin browser mode can not use DNS to discover seeds, so they are hard-coded.
see: https://github.com/bcoin-org/bdns/blob/master/lib/dns-browser.js#L23
There's already plenty in `/lib/net/seeds/main.js` so this is just to get browser-nodes running on testnet.
Seeds were pulled from my own `hosts.json` file on a live testnet bcoin node
2018-11-15 17:22:23 -08:00
Nodar Chkuaselidze
579a98a531
address: minor fixes
2018-11-15 17:39:25 +04:00
Buck Perley
e305d900d6
pkg: add currency and other info ( #623 )
...
matches expected outputs from hsd
2018-11-01 12:44:08 -07:00
Sky Young
31ee7f6367
Bump up coinbase expectations now that we include flodata
2018-10-20 14:17:24 -06:00
Sky Young
c41ab92f78
Add more checkpoints to mainnet and testnet :)
2018-10-20 14:10:55 -06:00
Sky Young
5131accc21
Check coinbase transaction for floData and include it in the size.
2018-10-20 13:55:50 -06:00
Sky Young
16005103e0
Get witness data as well for Coinbase Transaction.
2018-10-20 13:25:54 -06:00
Sky Young
60e19a7b02
Include version check
2018-10-20 13:07:58 -06:00
Sky Young
92184992ea
Add in floData to other Witness serizliation/deserialization functions
2018-10-20 13:03:53 -06:00
Sky Young
4d7b920048
Calculate the size of floData and add it to the bufferwriter initial size
2018-10-20 12:15:30 -06:00
Sky Young
36f88b398f
Create segwit signature hash with floData included :)
2018-10-20 11:32:12 -06:00
Sky Young
86dc7c601a
Replace Bitcoin and bcoin with Flo and fcoin respectively
2018-10-20 11:25:37 -06:00