aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/blockchain.cpp
AgeCommit message (Collapse)Author
2017-06-01Switch CCoinsView and chainstate db from per-txid to per-txoutPieter Wuille
This patch makes several related changes: * Changes the CCoinsView virtual methods (GetCoins, HaveCoins, ...) to be COutPoint/Coin-based rather than txid/CCoins-based. * Changes the chainstate db to a new incompatible format that is also COutPoint/Coin based. * Implements reconstruction code for hash_serialized_2. * Adapts the coins_tests unit tests (thanks to Russell Yanofsky). A side effect of the new CCoinsView model is that we can no longer use the (unreliable) test for transaction outputs in the UTXO set to determine whether we already have a particular transaction.
2017-06-01Refactor GetUTXOStats in preparation for per-COutPoint iterationPieter Wuille
2017-06-01Replace CCoins-based CTxMemPool::pruneSpent with isSpentPieter Wuille
2017-05-26Report on-disk size in gettxoutsetinfoPieter Wuille
2017-05-26Remove/ignore tx version in utxo and undoPieter Wuille
This makes the following changes: * In undo data and the chainstate database, the transaction nVersion field is removed from the data structures, always written as 0, and ignored when reading. * The definition of hash_serialized in gettxoutsetinfo is changed to no longer incude the nVersion field. It is renamed to hash_serialized_2 to avoid confusion. The new definition also includes transaction height and coinbase information, as this information was missing before. This depends on having a CHashVerifier-based undo data checksum verifier. Apart from changing the definition of serialized_hash, downgrading after using this patch is supported, as no release ever used the value of nVersion field in UTXO entries.
2017-05-23Merge #9571: RPC: getblockchaininfo returns BIP signaling statisticsWladimir J. van der Laan
557c9a6 RPC: getblockchaininfo: BIP9 stats (Matthew Zipkin) Tree-SHA512: ecf0bf47f04f92becc77acc649fdfa270e768939acce42df39d30069398d40d9a30539862f7c307e08239f78d5c58c470ca5f6e717d2ab8e24db9be0dd7bec0c
2017-05-15Merge #8704: [RPC] Transaction details in getblockWladimir J. van der Laan
e3c9f2d Use a verbosity instead of two verbose parameters (Andrew Chow) c99ab3c RPC: Allow multiple names for parameters (Luke Dashjr) Tree-SHA512: 686b38f6b0106563738d51f55666fe6d49a5b121b30d4480c2bfb640a59ede8e6f7f3c05c3c5d80a5288e127991e191d19d1d4f9ace566fd39edeb27b31857ff
2017-05-12Use a verbosity instead of two verbose parametersAndrew Chow
Verbose is changed to an int. This can have values from 0-2 for each level of verbosity. Verbosity level 2 has transaction details displayed in the results.
2017-05-09Merge #9279: Consensus: Move CFeeRate out of libconsensusWladimir J. van der Laan
381a46e Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus module (Jorge Timón) 330bb5a Consensus: Minimal way to move dust out of consensus (Jorge Timón) Tree-SHA512: 19a2ea8169afd5a9d3f940d8974e34cfaead153e3ff3068ac82fccdb8694d19d9b45938904ec9e8cd095bd5ca3a0080364da29372f6aaf56b11a6c2ccd6c7a4d
2017-05-08Merge #10310: [doc] Add hint about getmempoolentry to getrawmempool help.MarcoFalke
3a0a5bc [doc] Add hint about getmempoolentry to getrawmempool help. (Karl-Johan Alm) Tree-SHA512: 8327d7d7ad93296525fbf95b7a824e3525bde84653999f125afd845823eb39e3a03cd39725962ed949aa2b9ad207ecad6d287294fa321ff1a4d7fbd5a4b8560b
2017-05-06[doc] Add hint about getmempoolentry to getrawmempool help.Karl-Johan Alm
2017-05-03Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus moduleJorge Timón
...from amount.o to policy/feerate.o Policy, because it moves policy code to the policy directory (common module)
2017-05-03Add getchaintxstats RPCPieter Wuille
2017-05-02Remove unused forward declaration for non-existent ScriptPubKeyToJSON(...)practicalswift
2017-04-28refactor TxToJSON() and ScriptPubKeyToJSON()jonnynewbs
2017-04-01Change LogAcceptCategory to use uint32_t rather than sets of strings.Gregory Maxwell
This changes the logging categories to boolean flags instead of strings. This simplifies the acceptance testing by avoiding accessing a scoped static thread local pointer to a thread local set of strings. It eliminates the only use of boost::thread_specific_ptr outside of lockorder debugging. This change allows log entries to be directed to multiple categories and makes it easy to change the logging flags at runtime (e.g. via an RPC, though that isn't done by this commit.) It also eliminates the fDebug global. Configuration of unknown logging categories now produces a warning.
2017-03-29refactor: Make rest.cpp dependency on `*toJSON` in `blockchain.cpp` explicitWladimir J. van der Laan
2017-03-27refactor: Move GetDifficulty out of `rpc/server.h`Wladimir J. van der Laan
It has no business in `rpcserver.h`. Define it in the interface header of the implementation unit `rpcblockchain` where it is defined. Also modernize the signature to: double GetDifficulty(const CBlockIndex* blockindex = nullptr); (remove `extern`, replace `NULL` with `nullptr`)
2017-03-24RPC: getblockchaininfo: BIP9 statsMatthew Zipkin
add RPC tests for BIP9 counting stats
2017-03-09Merge #9853: Fix error codes from various RPCsWladimir J. van der Laan
adaa281 Update release notes to include RPC error code changes. (John Newbery) 338bf06 Add commenting around JSON error codes (John Newbery) dab804c Return correct error codes in fundrawtransaction(). (John Newbery) a012087 Return correct error codes in setban(). (John Newbery) 960bc7f Return correct error codes in removeprunedfunds(). (John Newbery) c119096 Return correct error codes in blockchain.cpp. (John Newbery) 6d07c62 Return correct error codes in bumpfee(). (John Newbery) Tree-SHA512: 4bb39ad221cd8c83d98ac5d7ad642f3a8c265522720dc86b2eebc70e74439a85b06d6ddcd6a874e879d986511de3ab0878bb7fe58b50cb0546b78913632ea809
2017-03-08Refactor: Remove using namespace <xxx> from rpc/Karl-Johan Alm
2017-03-07Return correct error codes in blockchain.cpp.John Newbery
RPCs in blockchain.cpp were returning misleading or incorrect error codes (for example getblock() returning RPC_INTERNAL_ERROR when the block had been pruned). This commit fixes those error codes: - RPC_INTERNAL_ERROR should not be returned for application-level errors, only for genuine internal errors such as corrupted data. - RPC_METHOD_NOT_FOUND should not be returned in response to a JSON request for an existing method. Those error codes have been replaced with RPC_MISC_ERROR or RPC_INVALID_PARAMETER as appropriate.
2017-03-07Merge #9602: Remove coin age priority and free transactions - implementationWladimir J. van der Laan
b421e6d Update example bitcoin.conf (Alex Morcos) 7d4e950 Allow setting minrelaytxfee to 0 (Alex Morcos) 359e8a0 [cleanup] Remove coin age priority completely. (Alex Morcos) f9b9371 [rpc] Remove priorityDelta from prioritisetransaction (Alex Morcos) 49be7e1 [rpc] Remove priority information from mempool RPC calls (Alex Morcos) 0315888 [test] Remove priority from tests (Alex Morcos) f838005 No longer allow "free" transactions (Alex Morcos) ad727f4 [rpc] sendrawtransaction no longer bypasses minRelayTxFee (Alex Morcos) fe282ac [cleanup] Remove estimatePriority and estimateSmartPriority (Alex Morcos) 400b151 [debug] Change -printpriority option (Alex Morcos) 272b25a [mining] Remove -blockprioritysize. (Alex Morcos) 12839cd [rpc] Remove estimatepriority and estimatesmartpriority. (Alex Morcos) ddf58c7 wallet: Remove sendfree (MarcoFalke) Tree-SHA512: a9a4499405923ce794ef18f9e334dbbd59dfc73a3dc2df6f85cc9c62af6f353ec2eed9c2d5e58e904f918d0d7ab738f403dd4939d9bc2276136864fe63710782
2017-03-03[rpc] Remove priority information from mempool RPC callsAlex Morcos
"startingpriority" and "currentpriority" are no longer returned in the JSON information about a mempool entry. This affects getmempoolancestors, getmempooldescendants, getmempooolentry, and getrawmempool.
2017-03-03Define 7200 second timestamp window constantRussell Yanofsky
2017-02-23Trivial: Rephrase the definition of difficulty in the code.Karl-Johan Alm
2017-02-16Add two hour buffer to manual pruningAlex Morcos
2017-01-12Replace FindLatestBefore used by importmuti with FindEarliestAtLeast.Gregory Maxwell
In spite of the name FindLatestBefore used std::lower_bound to try to find the earliest block with a nTime greater or equal to the the requested value. But lower_bound uses bisection and requires the input to be ordered with respect to the comparison operation. Block times are not well ordered. I don't know what lower_bound is permitted to do when the data is not sufficiently ordered, but it's probably not good. (I could construct an implementation which would infinite loop...) To resolve the issue this commit introduces a maximum-so-far to the block indexes and searches that. For clarity the function is renamed to reflect what it actually does. An issue that remains is that there is no grace period in importmulti: If a address is created at time T and a send is immediately broadcast and included by a miner with a slow clock there may not yet have been any block with at least time T. The normal rescan has a grace period of 7200 seconds, but importmulti does not.
2017-01-12Merge #9472: Disentangle progress estimation from checkpoints and update itWladimir J. van der Laan
df36371 Update estimated transaction count data (Pieter Wuille) e356d9a Shorten variable names and switch to tx/s (Pieter Wuille) 6dd8116 Remove SIGCHECK_VERIFICATION_FACTOR (Pieter Wuille) 3641141 Move tx estimation data out of CCheckPointData (Pieter Wuille) a4bac66 [MOVEONLY] Move progress estimation out of checkpoints (Pieter Wuille)
2017-01-12Merge #9518: Return height of last block pruned by pruneblockchain RPCMarcoFalke
918d1fb Return height of last block pruned by pruneblockchain RPC (Russell Yanofsky)
2017-01-12Merge #9297: Various RPC help outputs updatedMarcoFalke
54ee3fc RPC help updated (Michael Rotarius)
2017-01-11RPC help updatedMichael Rotarius
2017-01-11Return height of last block pruned by pruneblockchain RPCRussell Yanofsky
Change suggested by Jonas Schnelli <dev@jonasschnelli.ch> in https://github.com/bitcoin/bitcoin/pull/7871#discussion_r95577623
2017-01-10Merge #8811: rpc: Add support for JSON-RPC named argumentsWladimir J. van der Laan
4e7e2e1 Update RPC argument names (John Newbery) 481f289 rpc: Named argument support for bitcoin-cli (Wladimir J. van der Laan) 9adb4e1 rpc: Argument name consistency (Wladimir J. van der Laan) 8d713f7 rpc: Named arguments for rawtransaction calls (Wladimir J. van der Laan) 37a166f rpc: Named arguments for wallet calls (Wladimir J. van der Laan) 78b684f rpc: Named arguments for mining calls (Wladimir J. van der Laan) b8ebc59 rpc: Named arguments for net calls (Wladimir J. van der Laan) 2ca9dcd test: Add test for RPC named arguments (Wladimir J. van der Laan) fba1a61 rpc: Named arguments for misc calls (Wladimir J. van der Laan) 286ec08 rpc: Add 'echo' call for testing (Wladimir J. van der Laan) 495eb44 rpc: Named arguments for blockchain calls (Wladimir J. van der Laan) 6f1c76a rpc: Support named arguments (Wladimir J. van der Laan) 5865d41 authproxy: Add support for RPC named arguments (Wladimir J. van der Laan)
2017-01-10fixup! Add pruneblockchain RPC to enable manual block file pruning.Russell Yanofsky
Extend pruneblockchain RPC to accept block timestamps as well as block indices.
2017-01-10Add pruneblockchain RPC to enable manual block file pruning.mrbandrews
2017-01-10Update RPC argument namesJohn Newbery
2017-01-05Merge #8747: [rpc] Fix transaction size comments and RPC help text.Wladimir J. van der Laan
d29505d Fix transaction size comments. Size now refers to virtual size as defined in BIP141. (jonnynewbs)
2017-01-05rpc: Argument name consistencyWladimir J. van der Laan
The meaning is clear from the context, and we're inconsistent here. Also save typing when using named arguments. - `bitcoinaddress` -> `address` - `bitcoinprivkey` -> `privkey` - `bitcoinpubkey` -> `pubkey`
2017-01-05rpc: Named arguments for blockchain callsWladimir J. van der Laan
2017-01-04Move tx estimation data out of CCheckPointDataPieter Wuille
2017-01-04[MOVEONLY] Move progress estimation out of checkpointsPieter Wuille
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-12-22Added missing colons in when running help commandAnditto Heristyo
2016-12-08Fix transaction size comments. Size now refers to virtual size as defined in ↵jonnynewbs
BIP141.
2016-12-05Add option to return non-segwit serialization via rpcGregory Sanders
2016-12-04Make the optional pblock in ActivateBestChain a shared_ptrMatt Corallo
2016-12-02Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo
2016-11-24Correct help output for waitfor RPC commandsfanquake
2016-11-19Make CBlock::vtx a vector of shared_ptr<CTransaction>Pieter Wuille