Commit Graph

11908 Commits

Author SHA1 Message Date
Braydon Fuller 64b1d5a9c4 rpc: minimize locking in getrawtransaction
since there is i/o that can happen when retrieving extended input
and output information, limiting the duration of the lock in getrawtransaction
can help improve concurrency

Zcash: Use older script ASM function
2018-09-05 13:05:50 -07:00
Braydon Fuller 7aabf02719 db: add options to configure block index database
There was a previous assumption that blockindex would be quite small. With addressindex
and spentindex enabled the blockindex is much larger and the amount of cache allocated for
it should also increase. Furthermore, enabling compression should decrease the amount of
disk space required and less data to write/read. The default leveldb max_open_files is set to
1000, for the blockindex the default is set to 1000 with compression. The 64 value that is
current is kept for the utxo database and does not enable compression. Two additional options
are added here to be able to configure the values for leveldb and the block index:

- `-dbmaxopenfiles` A number of files for leveldb to keep open
- `-dbcompression` Boolean 0 or 1 to enable snappy leveldb compression
2018-09-05 13:05:50 -07:00
Braydon Fuller e1ad236924 Revert "rpc: add input confirmations to getrawtransaction" 2018-09-05 13:05:50 -07:00
Braydon Fuller 4993804584 mempool: same address and index for an input and output bug
fixes a bug that would happen when an output would match an input with
the same address and index, and would lead to the outputs not appearing
in results.
2018-09-05 13:05:50 -07:00
Braydon Fuller d43d59dca5 mempool: fix bug with mempool address index iteration
fixes a minor bug where iteration would not end when there are matching
hashes for a p2sh and p2pkh address, and would return results for
both addresses
2018-09-05 13:05:50 -07:00
Braydon Fuller 93b5719622 tests: expanded address index mempool testing 2018-09-05 13:05:49 -07:00
Braydon Fuller 3d4431a176 main: do not log error when spent info not found 2018-09-05 13:05:49 -07:00
Braydon Fuller ededdf1413 rpc: add input confirmations to getrawtransaction 2018-09-05 13:05:49 -07:00
Braydon Fuller 6e50c56edd main: spentindex for the mempool
Zcash: Adapted to older mempool code
2018-09-05 13:05:49 -07:00
Braydon Fuller fc5d4a55fe rpc: add input value and address to getrawtransaction if spentindex enabled 2018-09-05 13:05:49 -07:00
Braydon Fuller 67c95dcb7f main: add amount and address to spentindex value 2018-09-05 13:05:49 -07:00
Braydon Fuller 0e20c872b2 rpc: include satoshis in verbose raw transaction 2018-09-05 13:05:49 -07:00
Braydon Fuller 8376b90c6e rpc: add blockindex to getaddressdeltas method
for the purposes of secondary sorting by block order
2018-09-05 13:05:49 -07:00
Braydon Fuller d723656d79 rpc: include help text for addressindex and related commands 2018-09-05 13:05:49 -07:00
Braydon Fuller f83d3fe7a8 rpcclient: add params to be parsed as JSON
There was an issue where getblockhashes wouldn't work from bitcoin-cli
as the two params would be strings instead of integers. This fixes that
issue, and will parse the first param as JSON for other addressindex
related rpc methods.
2018-09-05 13:05:49 -07:00
Wladimir J. van der Laan 0713229fc9 tests: Make proxy_test work on travis servers without IPv6
Github-Pull: #7489
Rebased-From: 7539f1aae3b41279dc5d49e09f448a78a071e114
Cherry-picked-From: 9ca957bcd401de69c4c03904b9ee8b8b41052905
2018-09-05 13:05:49 -07:00
Braydon Fuller a4b8b3fdd4 rpc: update oksafemode for address commands 2018-09-05 13:05:47 -07:00
Braydon Fuller 29495b5e25 rpc: optional "start" and "end" params for getaddressdeltas 2018-09-05 13:03:35 -07:00
Braydon Fuller bc628e6e56 rpc: include base58check encoded address in results 2018-09-05 13:03:33 -07:00
Braydon Fuller 7175beebba test: test for getaddressmempool prevhash and prevout values 2018-09-05 12:58:14 -07:00
Braydon Fuller 047166bb42 rpc: include prevhash and prevout information for spending deltas 2018-09-05 12:58:14 -07:00
Braydon Fuller 9994a074e5 build: fix darwin build 2018-09-05 12:58:14 -07:00
Braydon Fuller ca0ee59d6e rpc: fix issue with querying txids by block heights 2018-09-05 12:58:14 -07:00
Braydon Fuller 4c4b882bb3 rpc: query txids for addresses within block height range 2018-09-05 12:58:14 -07:00
Braydon Fuller a14b90dbbb rpc: include height in spentinfo 2018-09-05 12:58:14 -07:00
Braydon Fuller a9e36d08a0 rpc: include spent info if spentindex enabled with getrawtransaction verbose 2018-09-05 12:58:14 -07:00
Braydon Fuller bf64e834c6 main: add spentindex option 2018-09-05 12:58:12 -07:00
Braydon Fuller 02ba86daba rpc: cast indexes to ints 2018-09-05 12:56:35 -07:00
Braydon Fuller 890a6ca3d1 build: add addressindex.h to make 2018-09-05 12:56:35 -07:00
Braydon Fuller ab6be4478e main: include timestampindex in help 2018-09-05 12:56:35 -07:00
Braydon Fuller eed0b77388 rpc: give back base58 encoded address format in utxos 2018-09-05 12:56:35 -07:00
Braydon Fuller 2f8d20ba76 main: mempool address index
Zcash: Integrated into older mempool code
2018-09-05 12:56:26 -07:00
Braydon Fuller e85d165115 main: sort address index utxos by height 2018-09-05 12:55:33 -07:00
Braydon Fuller 110adc6aa7 main: remove spent address utxo indexes 2018-09-05 12:55:33 -07:00
Braydon Fuller 6107ae66d2 main: don't undo indexes when verifying blocks at startup 2018-09-05 12:55:33 -07:00
Braydon Fuller 4725b25e60 main: update unspent address index during reorgs 2018-09-05 12:55:33 -07:00
Braydon Fuller f64ed53103 rpc: fix argument check for getaddressutxos 2018-09-05 12:55:33 -07:00
Braydon Fuller 724f06da7c main: index unspent outputs by address 2018-09-05 12:55:30 -07:00
Braydon Fuller b621a432da main: fix order of address index when disconnecting block 2018-09-05 12:54:28 -07:00
Braydon Fuller 230783d4b3 main: update address index during reorgs 2018-09-05 12:53:00 -07:00
Braydon Fuller 372ae61bfb rpc: optimize address txid queries 2018-09-05 12:52:59 -07:00
Braydon Fuller 98872dac95 main: get address deltas between range of block heights 2018-09-05 12:52:56 -07:00
Braydon Fuller 70600ae1ff main: fixed bug with overlapping address index keys
There was a bug where the spending address index could have the same key
as the receiving address index if the input and output indexes matched. This lead
to the output always overwriting the input index leading to incorrect balances
with missing spent amounts. This patch separates the two so that they have unique
keys so balances will be correctly calculated.
2018-09-05 12:51:27 -07:00
Braydon Fuller 3d90427d0b test: added to for balance after spending 2018-09-05 12:51:27 -07:00
Braydon Fuller 4fcfdc9b21 main: add block timestamp index 2018-09-05 12:51:25 -07:00
Braydon Fuller 59568ff5e8 rpc: include height in getrawtransaction results 2018-09-05 12:49:20 -07:00
Braydon Fuller c4c22aefc3 rpc: add receieved to balance 2018-09-05 12:49:20 -07:00
Braydon Fuller d2e961bd94 rpc: added getaddressbalance method using addressindex 2018-09-05 12:49:17 -07:00
Braydon Fuller 72bd01411d rpc: only sort when combining multiple results
It's only necessary to sort when combining results for several addresses
as the results are already in order from the database.
2018-09-05 12:47:11 -07:00
Braydon Fuller 8432e73cf2 main: serialize height in BE for address index key
fixes a sorting issue when iterating over keys
2018-09-05 12:47:11 -07:00