aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
AgeCommit message (Collapse)Author
2019-06-06Merge #16129: refactor: Remove unused includesMarcoFalke
67f4e9c522 Include core_io.h from core_read.cpp (practicalswift) eca9767673 Make reasoning about dependencies easier by not including unused dependencies (practicalswift) Pull request description: Make reasoning about dependencies easier by not including unused dependencies. Please note that the removed headers are _not_ "transitively included" by other still included headers. Thus the removals are real. As an added bonus this change means less work for the preprocessor/compiler. At least 51 393 lines of code no longer needs to be processed: ``` $ git diff -u HEAD~1 | grep -E '^\-#include ' | cut -f2 -d"<" | cut -f1 -d">" | \ sed 's%^%src/%g' | xargs cat | wc -l 51393 ``` Note that 51 393 is the lower bound: the real number is likely much higher when taking into account transitively included headers :-) ACKs for commit 67f4e9: Tree-SHA512: 0c8868aac59813f099ce53d5307eed7962dd6f2ff3546768ef9e5c4508b87f8210f1a22c7e826c3c06bebbf28bdbfcf1628ed354c2d0fdb9a31a42cefb8fdf13
2019-06-05Merge #15976: refactor: move methods under CChainState (pt. 1)Wladimir J. van der Laan
403e677c9 refactoring: IsInitialBlockDownload -> CChainState (James O'Beirne) 3ccbc376d refactoring: FlushStateToDisk -> CChainState (James O'Beirne) 4d6688603 refactoring: introduce ChainstateActive() (James O'Beirne) d7c97edee move-only: make the CChainState interface public (James O'Beirne) Pull request description: This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11): Parent PR: #15606 Issue: #15605 Specification: https://github.com/jamesob/assumeutxo-docs/tree/2019-04-proposal/proposal --- This changeset starts moving functionality intimately related to CChainState into methods. Parameterizing these functions by a particular CChainState is necessary for the use of multiple chainstates simultaneously (e.g. for asynchronous background validation). In this change, we - make the CChainState interface public - since other units will start to invoke its methods directly, - introduce `::ChainstateActive()`, the CChainState equivalent for `::ChainActive()`, - and move `IsInitialBlockDownload()` and `FlushStateToDisk()` into methods on CChainState. Independent of assumeutxo, these changes better encapsulate chainstate behavior and allow easier use from a testing context. There are more methods that we'll move in the future, but they require other substantial changes (i.e. moving ownership of the `CCoinsView*` hierarchy into CChainState) so we'll save them for future PRs. --- The first move-only commit is most easily reviewed with `git diff ... --color-moved=dimmed_zebra`. ACKs for commit 403e67: Empact: utACK https://github.com/bitcoin/bitcoin/pull/15976/commits/403e677c9ebbf9744733010e6b0c2d1b182ee850 no need to address my nits herein Sjors: utACK 403e677 ryanofsky: utACK 403e677c9ebbf9744733010e6b0c2d1b182ee850. Only change since previous review is removing global state comment as suggested. MarcoFalke: utACK 403e677c9e, though the diff still seems a bit bloated with some unnecessary changes in the second commit. promag: utACK 403e677 and rebased with current [master](c7cfd20a7). Tree-SHA512: 6fcf260bb2dc201361170c0b4547405366f5f331fcc3a2bac29b24442814b7b244ca1b58aac5af716885f9a130c343b544590dff780da0bf835c7c5b3ccb2257
2019-06-02Make reasoning about dependencies easier by not including unused dependenciespracticalswift
2019-05-23Merge #16024: [rpc] deriveaddresses: Correction of descriptor checksum in ↵MarcoFalke
RPC example e23809a05b [rpc] deriveaddresses: Correct descriptor checksum in RPCExamples (Chris Capobianco) Pull request description: Trvial: This fixes the descriptor checksum found the in the deriveaddresses RPC example. The current checksum value does work, but only if the "h" used for the hardened derivation key origin are replaced with "'". Given the discussion to switch from "'" to "h" [here](https://github.com/bitcoin/bitcoin/issues/15740), I thought it made more sense to update the checksum rather then changing all the "h" to "'" in this example. ACKs for commit e23809: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/16024/commits/e23809a05b22a5eec354d63980bbddf040d67c3f Tree-SHA512: 06a2b9f3e714ecde9b9a80b3b7a4082eb072e71d8abcc455ff5387e470d48839f22a70b78bbae1cf9122cb133fee46830819b6f39d67aec8c3c8d5889ae94e04
2019-05-16Merge #15990: Add tests and documentation for blocksonlyWladimir J. van der Laan
fa8ced32a60dea37ac169241cf9a1f708ef46c4b doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke) fa320de79faaca2b088fcbe7f76701faa9bff236 test: Add test for p2p_blocksonly (MarcoFalke) fa3872e7b4540857261aed948b94b6b2bfdbc3d1 test: Format predicate source as multiline on error (MarcoFalke) fa1dce7329d3e74d46ab98b93772b1832a3f1819 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke) Pull request description: This is de-facto no longer hidden ACKs for commit fa8ced: jamesob: utACK https://github.com/bitcoin/bitcoin/commit/fa8ced32a60dea37ac169241cf9a1f708ef46c4b Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
2019-05-16refactoring: IsInitialBlockDownload -> CChainStateJames O'Beirne
We introduce CChainState.m_cached_finished_ibd because the static state it replaces would've been shared across all CChainState instances.
2019-05-16refactoring: FlushStateToDisk -> CChainStateJames O'Beirne
Also renames global methods for clarity: - ::FlushStateToDisk() -> CChainState::ForceFlushStateToDisk() - This performs an unconditional flush. - ::PruneAndFlush() -> CChainState::PruneAndFlush()
2019-05-15Merge #14984: rpc: Speedup getrawmempool when verbose=trueMarcoFalke
2d5cf4c41d rpc: Speedup getrawmempool when verbose=true (João Barbosa) Pull request description: Instead of calling `pushKV(hash, info)`, which incurs in duplicate key checks, call `__pushKV` which (currently) doesn't. Improves RPC `getrawmempool` and REST `/rest/mempool/contents.json`. Fixes #14765. ACKs for commit 2d5cf4: Tree-SHA512: c3e91371bb41f39e79dcef820815e1dc27fb689ca3c4bf3a00467d2215b3baecd44d9792f7a481577a5b7ae1fc6cbaa07b1cd62123b845082eba65b35c2b3ca5
2019-05-14[rpc] deriveaddresses: Correct descriptor checksum in RPCExamplesChris Capobianco
2019-05-10Merge #14802: rpc: faster getblockstats using BlockUndo dataMarcoFalke
d20d756752 rpc: faster getblockstats using BlockUndo data (Felix Weis) Pull request description: Using undo data for a block (rev?????.dat) we can retrieve value information about prevouts and calculate the final transaction fee (rate). This approach is about 80x faster, drops the requirement for `-txindex`, and works for all non-pruned blocks. ``` # 2018-11-25T16:36:19Z Bitcoin Core version v0.17.99.0-edc715240-dirty (release build) seq 550100 550200 0.00s user 0.00s system 62% cpu 0.004 total xargs -n1 src/bitcoin-cli getblockstats 0.21s user 0.19s system 17% cpu 2.302 total # 2018-11-25T16:39:17Z Bitcoin Core version v0.17.0 (release build) seq 550100 550200 0.00s user 0.00s system 87% cpu 0.002 total xargs -n1 src/bitcoin-cli getblockstats 0.24s user 0.22s system 0% cpu 3:19.42 total ``` ACKs for commit d20d75: MarcoFalke: re-utACK d20d7567528e216badb8475df298bb3cec008985 Tree-SHA512: 5babc3eb8d2fee2cb23dc12f522656b80737a540cbf2b13390a8f388304c46c064cca76f896b46a6e2abae8cc582d28e1ab20dd4bb17ad6142f20630c2d30c54
2019-05-10rpc: faster getblockstats using BlockUndo dataFelix Weis
Using undo data for a block (rev?????.dat) we can retrieve value information about prevouts and calculate the final transaction fee (rate). This approach is about 80x faster, drops the requirement for -txindex, and works for all non-pruned blocks.
2019-05-10Merge #15744: refactor: Extract ParseDescriptorRangeMarcoFalke
510c6532ba Extract ParseDescriptorRange (Ben Woosley) Pull request description: So as to be consistently informative when the checks fail, and to protect against unintentional divergence among the checks. ACKs for commit 510c65: meshcollider: Oh apologies, yes. Thanks :) utACK https://github.com/bitcoin/bitcoin/pull/15744/commits/510c6532bae9abc5beda1c126c945923a64680cb MarcoFalke: utACK 510c6532bae9abc5beda1c126c945923a64680cb sipa: utACK 510c6532bae9abc5beda1c126c945923a64680cb Tree-SHA512: b1f0792bfaa163890a20654a0fc2c4c4a996659916bf5f4a495662436b39326692a1a0c825caafd859e48c05f5dd1865c4f7c28092be5074edda3c94f94f9f8b
2019-05-09Merge #15452: Replace CScriptID and CKeyID in CTxDestination with dedicated ↵Wladimir J. van der Laan
types 78e407ad0c26190a22de1bc8ed900164a44a36c3 GetKeyBirthTimes should return key ids, not destinations (Gregory Sanders) 70946e7fee54323ce6a5ea8aeb377e2c7c790bc6 Replace CScriptID and CKeyID in CTxDestination with dedicated types (Gregory Sanders) Pull request description: The current usage seems to be an overloading of meanings. `CScriptID` is used in the wallet as a lookup key, as well as a destination, and `CKeyID` likewise. Instead, have all destinations be dedicated types. New types: `CScriptID`->`ScriptHash` `CKeyID`->`PKHash` ACKs for commit 78e407: ryanofsky: utACK 78e407ad0c26190a22de1bc8ed900164a44a36c3. Only changes are removing extra CScriptID()s and fixing the test case. Sjors: utACK 78e407a meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/15452/commits/78e407ad0c26190a22de1bc8ed900164a44a36c3 Tree-SHA512: 437f59fc3afb83a40540da3351507aef5aed44e3a7f15b01ddad6226854edeee762ff0b0ef336fe3654c4cd99a205cef175211de8b639abe1130c8a6313337b9
2019-05-09net: Rename ::fRelayTxes to ::g_relay_txesMarcoFalke
This helps to distinguish it from CNode::fRelayTxes and avoid bugs like 425278d17bd0edf8a3a7cc81e55016f7fd8e7726
2019-05-03scripted-diff: replace chainActive -> ::ChainActive()James O'Beirne
Though at the moment ChainActive() simply references `g_chainstate.m_chain`, doing this change now clears the way for multiple chainstate usage and allows us to script the diff. -BEGIN VERIFY SCRIPT- git grep -l "chainActive" | grep -E '(h|cpp)$' | xargs sed -i '/chainActive =/b; /extern CChain& chainActive/b; s/\(::\)\{0,1\}chainActive/::ChainActive()/g' -END VERIFY SCRIPT-
2019-05-03Merge #15932: rpc: Serialize in getblock without cs_mainMarcoFalke
faea56400d rpc: Add lock annotations to block{,header}ToJSON (MarcoFalke) fab00a5cb9 rpc: Serialize in getblock without cs_main (MarcoFalke) fa1c3591ad rpc: Use IsValidNumArgs in getblock (MarcoFalke) Pull request description: No need to hold cs_main when serializing a struct to json Fixes: #15925 ACKs for commit faea56: jnewbery: utACK faea56400d5578023133cf4d1c761cdeb0c3e3da jonasschnelli: utACK faea56400d5578023133cf4d1c761cdeb0c3e3da Tree-SHA512: 005d378cda1e6024e9f5142f99a8adbefe202cd7bfeaafee55eb909e8990a3790aa27fcf5dd16119cc9afe9dc8bd30f660de40233316781669be166bac3018e7
2019-05-02rpc: Add lock annotations to block{,header}ToJSONMarcoFalke
2019-05-01rpc: Serialize in getblock without cs_mainMarcoFalke
2019-05-01rpc: Use IsValidNumArgs in getblockMarcoFalke
2019-05-01Merge #15323: rpc: Expose g_is_mempool_loaded via getmempoolinfoMarcoFalke
effe81f750 Move g_is_mempool_loaded into CTxMemPool::m_is_loaded (Ben Woosley) bb8ae2c419 rpc: Expose g_is_mempool_loaded via getmempoolinfo and /rest/mempool/info.json (Ben Woosley) Pull request description: And use it to fix a race condition in mempool_persist.py: https://travis-ci.org/Empact/bitcoin/jobs/487577243 Since e.g. getrawmempool returns errors based on this status, this enables users to test it for readiness. Fixes #12863 ACKs for commit effe81: MarcoFalke: utACK effe81f750 jnewbery: utACK effe81f7503d2ca3c88cfdea687f9f997f353e0d Tree-SHA512: 74328b0c17a97efb8a000d4ee49b9a673c2b6dde7ea30c43a6a2eff961a233351c9471f9a42344412135786c02bdf2ee1b2526651bb8fed68bd94d2120c4ef86
2019-04-29Replace CScriptID and CKeyID in CTxDestination with dedicated typesGregory Sanders
2019-04-27Merge #15784: rpc: Remove dependency on interfaces::Chain in SignTransactionMeshCollider
99e88a372 rpc: Remove dependency on interfaces::Chain in SignTransaction (Antoine Riard) Pull request description: Assuming wallet RPCs and node RPCs will go into different processes, signrawtransactionwithkey doesn't need to access Coins via interfaces::Chain, it may use directly utility in node/coins.cpp Obviously will need rebase after #15638 Tree-SHA512: 42ee8fcbcd38643bbd82210db6f68249bed5ee036a4c930a1db534d0469a133e287b8869c977bf0cc79a7296dde04f72adb74d24e1cd20f4a280f4c2b7fceb74
2019-04-19Merge #15670: refactor: combine ↵MarcoFalke
Chain::findFirstBlockWithTime/findFirstBlockWithTimeAndHeight 765c0b364d refactor: combine Chain::findFirstBlockWithTime/findFirstBlockWithTimeAndHeight (Antoine Riard) Pull request description: As suggested in #14711, pass height to CChain::FindEarliestAtLeast to simplify Chain interface by combining findFirstBlockWithTime and findFirstBlockWithTimeAndHeight into one ACKs for commit 765c0b: jnewbery: utACK 765c0b364d41e9a251c3f88cbe203645854fd790. Nice work @ariard! ryanofsky: utACK 765c0b364d41e9a251c3f88cbe203645854fd790. Looks good, thanks for implementing the suggestion! Tree-SHA512: 63f98252a93da95f08c0b6325ea98f717aa9ae4036d17eaa6edbec68e5ddd65672d66a6af267b80c36311fffa9b415a47308e95ea7718b300b685e23d4e9e6ec
2019-04-19Merge #15655: Resolve the checkpoints <-> validation circular dependencyMarcoFalke
418d3230f8 Resolve the checkpoints <-> validation CD. (251) Pull request description: This pull request attempts to resolve the `checkpoints -> validation -> checkpoints` circular dependency. The circular dependency is resolved by moving the `CheckPoints::GetLastCheckpoint(const CCheckpointData& data)` function to `validation.cpp` where it used exclusively by the private function `ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& params, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)`. ACKs for commit 418d32: promag: utACK 418d323, only `GetLastCheckpoint` usage is in `validation.cpp` and so makes sense to move it there. practicalswift: utACK 418d3230f86f77dde6e817f502baff8a54b707fa MarcoFalke: utACK 418d3230f86f77dde6e817f502baff8a54b707fa sipa: utACK 418d3230f86f77dde6e817f502baff8a54b707fa Tree-SHA512: 03c3556bc192e65f5e3fa76fd545d4ee7d63d3fb06b132f7a1fa6131aa21ddd2e5b2d19e2222dfe524f422daaca30efde219bed188db8c74ff4b088876b5bc16
2019-04-18Merge #14121: Index for BIP 157 block filtersMarcoFalke
c7efb652f3 blockfilter: Update BIP 158 test vectors. (Jim Posen) 19308c9e21 rpc: Add getblockfilter RPC method. (Jim Posen) ff35105096 init: Add CLI option to enable block filter index. (Jim Posen) accc8b8b18 index: Access functions for global block filter indexes. (Jim Posen) 2bc90e4e7b test: Unit test for block filter index reorg handling. (Jim Posen) 6bcf0998c0 test: Unit tests for block index filter. (Jim Posen) b5e8200db7 index: Implement lookup methods on block filter index. (Jim Posen) 75a76e3619 index: Implement block filter index with write operations. (Jim Posen) 2ad2338ef9 serialize: Serialization support for big-endian 32-bit ints. (Jim Posen) ba6ff9a6f7 blockfilter: Functions to translate filter types to/from names. (Jim Posen) 62b7a4f094 index: Ensure block locator is not stale after chain reorg. (Jim Posen) 4368384f1d index: Allow atomic commits of index state to be extended. (Jim Posen) Pull request description: This introduces a new BlockFilterIndex class, which is required for BIP 157 support. The index is uses the asynchronous BaseIndex infrastructure driven by the ValidationInterface callbacks. Filters are stored sequentially in flat files and the disk location of each filter is indexed in LevelDB along with the filter hash and header. The index is designed to ensure persistence of filters reorganized out of the main chain to simplify the BIP 157 net implementation. Stats (block height = 565500): - Syncing the index from scratch takes 45m - Total index size is 3.8 GiB ACKs for commit c7efb6: MarcoFalke: utACK c7efb652f3543b001b4dd22186a354605b14f47e ryanofsky: Slightly tested ACK c7efb652f3543b001b4dd22186a354605b14f47e (I just rebuilt the index with the updated PR and tested the RPC). Changes since last review: rebase, fixed compile errors in internal commits, new comments, updated error messages, tweaked cache size logic, renamed commit method, renamed constants and globals, fixed whitespace, extra BlockFilterIndex::Init error check. Tree-SHA512: f8ed7a9b6f76df45933aa5eba92b27b3af83f6df2ccb3728a5c89eec80f654344dc14f055f6f63eb9b3a7649dd8af6553fe14969889e7e2fd2f8461574d18f28
2019-04-17Merge #15474: rest/rpc: Make mempoolinfo atomicMarcoFalke
e377846ff1 rest/rpc: Make mempoolinfo atomic (João Barbosa) Pull request description: Make `/rest/mempool/info.json` endpoint and `getmempoolinfo` RPC atomic. ACKs for commit e37784: Tree-SHA512: 6b40844df813e180d68731fc263bd9a2c2a01fe143a4f5a8974e3e0023e6e2e1e9bc46669ddfdf44f0e47142feda2a2aad1ea02ef8837081e11522347f314b0b
2019-04-17rpc: Remove dependency on interfaces::Chain in SignTransactionAntoine Riard
Comment SignTransaction utility
2019-04-15Merge #15770: rpc: Validate maxfeerate with AmountFromValueMarcoFalke
aa410c2b17 rpc: Validate maxfeerate with AmountFromValue (João Barbosa) Pull request description: With this change `maxfeerate` can also be set as a string, accordingly to the help test: ``` maxfeerate (numeric or string, ``` Beside, there are no tests for the removed errors. ACKs for commit aa410c: meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/15770/commits/aa410c2b17c0320123fde3d3bf205a64d86b8696 MarcoFalke: utACK aa410c2b17 Good catch Tree-SHA512: f3bfea91dc7daa943729e270585dbf333055aeda805fbd01eaab20a7e0e6147382647c11525334382d198df0d3d45da6102b541efda5a1361f96271c98d5d89d
2019-04-15Merge #15751: Speed up deriveaddresses for large rangesWladimir J. van der Laan
41a46cbb31f1622f7d1ff54c7a1c1ca701c1e754 Speed up deriveaddresses for large ranges (Pieter Wuille) Pull request description: `deriveaddresses` dumps all generated addresses into a single `FlatSigningProvider`, which is also used for looking up information for future derivations. @achow101 points out that the growing data structures may unnecessary increase lookup time for later derivations. Fix this by separating the provider used for lookups (`key_provider`) and the one we dump things into. This gives a 10x speedup for a range of 7000 elements, and probably a larger speedup for larger ranges. ACKs for commit 41a46c: achow101: Regardless, I do think this is a good change, so utACK 41a46cbb31f1622f7d1ff54c7a1c1ca701c1e754 fanquake: tACK 41a46cb meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/15751/commits/41a46cbb31f1622f7d1ff54c7a1c1ca701c1e754 Tree-SHA512: a1b894ce9d5195d8f9760f44acc6d67a90bb259283fd8c1524c38a222fe53e8c1d35b6653a508b121b7ad91e155c97d26c658f6bdcebf6c360546931e4a26a22
2019-04-14Merge #15748: [rpc] remove dead mining codeMeshCollider
1b46a4889 [cleanup] Remove unused CReserveKey (John Newbery) 9819ad6d0 [rpc] simplify generate RPC (John Newbery) Pull request description: Removes dead code from after the generate method was removed ACKs for commit 1b46a4: MarcoFalke: utACK 1b46a4889f894d63062454fb9f4c2e88689a9d75 meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/15748/commits/1b46a4889f894d63062454fb9f4c2e88689a9d75 scravy: utACK 1b46a48 Empact: utACK https://github.com/bitcoin/bitcoin/pull/15748/commits/1b46a4889f894d63062454fb9f4c2e88689a9d75 Tree-SHA512: d1fab1bf76ac3036b85cf33be89868bc016f912575545ecaa16f958397b0ec4f1ce4de8fe254d4f21aabeea9c83a8928530cc520de26af0d1a8bdb4ca0f2cb77
2019-04-13Extract ParseDescriptorRangeBen Woosley
So as to be consistently informative when the checks fail, and to protect against unintentional divergence among the checks.
2019-04-10[rpc] simplify generate RPCJohn Newbery
Removes dead code from after the generate method was removed
2019-04-10Merge #15638: Move-only: Pull wallet code out of libbitcoin_serverWladimir J. van der Laan
4d074e84a2cf419510e2920417799f62747f4b07 [build] Move AnalyzePSBT from psbt.cpp to node/psbt.cpp (Russell Yanofsky) fd509bd1f71df628b933ea7a135a9a957a5e0136 [docs] Document src subdirectories and different libraries (John Newbery) 9eaeb7fb8d4ab0d4493849e6c17e314fd75fea9c [build] Move wallet load functions to wallet/load unit (John Newbery) 91a25d1e711bfc0617027eee18b9777ff368d6b9 [build] Add several util units (John Newbery) 99517866b62c261f990e1f897502855afc12f2a7 [build] Move several units into common libraries (John Newbery) 0509465542d63a5bbe7296f283f44dd491e74f78 [build] Move rpc rawtransaction util functions to rpc/rawtransaction_util.cpp (John Newbery) 1acc61f8746bc6efb905e121a9f607c4f5982b35 [build] Move rpc utility methods to rpc/util (John Newbery) 4a75c9d6512a5580e60104103ea11d2cd9586354 [build] Move policy settings to new src/policy/settings unit (John Newbery) fdf8888b6f0c63e8a4cb1459752625e642d6a4dd [build] Move CheckTransaction from lib_server to lib_consensus (John Newbery) Pull request description: This is a move-only commit. No code is changing and the moves can be easily verified with: ```sh git log -p -n1 --color-moved=dimmed_zebra ``` This commit moves functions and variables that wallet code depends on out of libbitcoin_server.a, so the bitcoin-wallet tool can be built without libbitcoin_server.a in #15639, and attempting to access server state from wallet code will result in link errors instead of silently broken code. List of moves: - `CheckTransaction` moves from `consensus/tx_verify.cpp` to `consensus/tx_check.cpp` - `urlDecode` moves from `httpserver.cpp` to `util/url.cpp` - `TransactionErrorString` moves from `node/transaction.cpp` to `util/error.cpp` - `StringForFeeReason` and `FeeModeFromString` move from `policy/fees.cpp` to `util/fees.cpp` - `incrementalRelayFee` `dustRelayFee` and `nBytesPerSigOp` move from `policy/policy.cpp` to `policy/settings.cpp` - `SignalsOptInRBF` moves from `policy/rbf.cpp` to `util/rbf.cpp` - `fIsBareMultisigStd` moves from `validation.cpp` to `policy/settings.cpp` - `ConstructTransaction` `TxInErrorToJSON` and `SignTransaction` move from `rpc/rawtransaction.cpp` to `rpc/rawtransaction_util.cpp` - `RPCTypeCheck` `RPCTypeCheckArgument` `RPCTypeCheckObj` `AmountFromValue` `ParseHashV``ParseHashO` `ParseHexV` `ParseHexO` `HelpExampleCli` and `HelpExampleRpc` move from `rpc/server.cpp` to `rpc/util.cpp` - `AmountHighWarn` and `AmountErrMsg` move from `ui_interface.cpp` to `util/error.cpp` - `FormatStateMessage` and `strMessageMagic` move from `validation.cpp` to `util/validation.cpp` - `VerifyWallets` `LoadWallets` `StartWallets` `FlushWallets` `StopWallets` and `UnloadWallets` move from `wallet/init.cpp` to `wallet/node.cpp` ACKs for commit 4d074e: jnewbery: utACK 4d074e84a2cf419510e2920417799f62747f4b07 (checked by doing the rebase myself and verifying no difference between my branch and 4d074e84a2cf419510e2920417799f62747f4b07) Tree-SHA512: 5e1604a9fb06475f2b96da0de0baa8330f4dda834dc20a0183ef11e1e4c27631d1d1bbb9abf0054efc03d56945fdf9920f63366b6a4f200f665b742a479ff75c
2019-04-10Remove access to node globals from wallet-linked codeRussell Yanofsky
Remove last few instances of accesses to node global variables from wallet code. Also remove accesses to node globals from code in policy/policy.cpp that isn't actually called by wallet code, but does get linked into wallet code. This is the last change needed to allow bitcoin-wallet tool to be linked without depending on libbitcoin_server.a, to ensure wallet code doesn't access node global state and avoid bugs like https://github.com/bitcoin/bitcoin/pull/15557#discussion_r267735431
2019-04-10Merge #15754: rpc: getrpcinfo docsMarcoFalke
f4b7a2f205 rpc: getrpcinfo docs (Ben Carman) Pull request description: Fixes #15731 ACKs for commit f4b7a2: laanwj: utACK f4b7a2f2055fa52d5e02c37bed7b46599b960e2e Tree-SHA512: 45dce83c4bfac2ddf85133a29aee332e9de8f73c15438ce899a2edbcd0d82d4f743753f6699c50cbc62d110fa8c6bc257722447e1090cdd23acbe00f26014ec8
2019-04-09Merge #15746: rpc: RPCHelpMan: Always name dictionary keysMarcoFalke
fa26eb5e8f rpc: RPCHelpMan: Always push_name when outer type is an object (MarcoFalke) fa652b229e rpc: Add some doxygen comments to utils (MarcoFalke) Pull request description: Fixes two issues reported in #15737: * > I am very perplexed as to how the code I'm looking at is generating the help text I'm seeing So add documentation * > This is a value for which a key is missing So always serialize the name of the dictionary key if the outer type is a dictionary ACKs for commit fa26eb: promag: Tested ACK fa26eb5. Tree-SHA512: b6f0cee1f1123d245d4902e8e113b5260cae7f2cb39c9bfb8893c5b0b33ffb6349ad05813d560d39a94ccf655399c05fcda15d9b0733e6bd696538fe0aca7021
2019-04-09[build] Move AnalyzePSBT from psbt.cpp to node/psbt.cppRussell Yanofsky
psbt.cpp definitions except for AnalyzePSBT are used by the wallet and need to be linked into the wallet binary. AnalyzePSBT is an exception in that it is not used by the wallet, and depends on node classes like CCoinsViewCache, and on node global variables like nBytesPerSigOp. So AnalyzePSBT is more at home in libbitcoin_server than libbitcoin_common, and in any case needs to be defined in a separate object file than other PSBT utilities, to avoid dragging link dependencies on node functions and global variables into the wallet.
2019-04-09[build] Add several util unitsJohn Newbery
Adds the following util units and adds them to libbitcoin_util: - `util/url.cpp` takes `urlDecode` from `httpserver.cpp` - `util/error.cpp` takes `TransactionErrorString` from `node/transaction.cpp` and `AmountHighWarn` and `AmountErrMsg` from `ui_interface.cpp` - `util/fees.cpp` takes `StringForFeeReason` and `FeeModeFromString` from `policy/fees.cpp` - `util/rbf.cpp` takes `SignalsOptInRBF` from `policy/rbf.cpp` - 'util/validation.cpp` takes `FormatStateMessage` and `strMessageMagic` from 'validation.cpp`
2019-04-09[build] Move rpc rawtransaction util functions to rpc/rawtransaction_util.cppJohn Newbery
rpc/rawtransaction.cpp moves to libbitcoin_server since it should not be accessed by non-node libraries. The utility following utility methods move to their own unit rpc/rawtransaction_util since they need to be accessed by non-node libraries: - `ConstructTransaction` - `TxInErrorToJSON` - `SignTransaction`
2019-04-09[build] Move rpc utility methods to rpc/utilJohn Newbery
Moves the following utility methods to rpc/util and moves that unit to libbitcoin_common so they can be accessed by all libraries. - `RPCTypeCheck` - `RPCTypeCheckArgument` - `RPCTypeCheckObj` - `AmountFromValue` - `ParseHashV``ParseHashO` - `ParseHexV` - `ParseHexO` - `HelpExampleCli` - `HelpExampleRpc`
2019-04-09[build] Move policy settings to new src/policy/settings unitJohn Newbery
This moves the following policy settings functions and globals to a new src/policy/settings unit in lib_server: - `incrementalRelayFee` - `dustRelayFee` - `nBytesPerSigOp` - `fIsBareMultisigStd` These settings are only required by the node and should not be accessed by other libraries.
2019-04-08rpc: Validate maxfeerate with AmountFromValueJoão Barbosa
2019-04-08Merge #15760: doc: Clarify sendrawtransaction::maxfeerate==0 helpMarcoFalke
fa49db7eac doc: Clarify sendrawtransaction::maxfeerate==0 help (MarcoFalke) Pull request description: Used a lot in e.g. the tests: `git grep 'maxfeerate=0)' test` ACKs for commit fa49db: promag: ACK fa49db7. jonatack: ACK https://github.com/bitcoin/bitcoin/pull/15760/commits/fa49db7eacecfe0657797aa4aa3c783c4527e19f Tree-SHA512: cb3fa10960f45606c3599b76c48666a663e5c44cfb7c29bab5d44caa7dc6cb57aaac81cb9b173e079dde01d07c5363c99416f25303a8fd41010928118474a741
2019-04-06doc: Clarify sendrawtransaction::maxfeerate==0 helpMarcoFalke
2019-04-06rpc: Add getblockfilter RPC method.Jim Posen
Retrieves and returns block filter and header from index.
2019-04-06Merge #15508: Refactor analyzepsbt for use outside RPC codePieter Wuille
892eff05f1 Add documentation of struct PSBTAnalysis et al (Glenn Willen) ef22fe8c1f Refactor analyzepsbt for use outside RPC code (Glenn Willen) afd20a25f2 Move PSBT decoding functions from core_io to psbt.cpp (Glenn Willen) Pull request description: Refactor the analyzepsbt RPC into (1) an AnalyzePSBT function, which returns its output as a new strongly-typed PSBTAnalysis struct, and (2) a thin wrapper which converts the struct into a UniValue for RPC use. ---- As with my previous refactoring PR, I need this because I am creating a dependency on this code from the GUI. Per discussion in #bitcoin-core-dev on IRC, since we don't want to create a dependency on UniValue in anything outside RPC, I introduced some new structs to hold the info we get when analyzing a PSBT. For the field types, I used whatever types are already used internally for this data (e.g. CAmount, CFeeRate, CKeyID), and only convert to int/string etc. in the wrapper. @achow101, maybe take the first look? :-) ACKs for commit 892eff: sipa: utACK 892eff05f115c0b002d0e0b6ffc3ab418480d25c achow101: utACK 892eff05f115c0b002d0e0b6ffc3ab418480d25c ryanofsky: utACK 892eff05f115c0b002d0e0b6ffc3ab418480d25c. Just small cleanups since the last review: removing unneeded include, forward decl, adding const ref Tree-SHA512: eb278b0a82717ebc3eb0c08dc5bb4eefb996a317a6a3a8ecf51cd88110ddbb188ad3482cdd9563e557995e73aca5a282c1f6e352bc598155f1203b7b46fe5dee
2019-04-05Remove unused varPeter Bushnell
2019-04-05rpc: getrpcinfo docsBen Carman
2019-04-04Speed up deriveaddresses for large rangesPieter Wuille
2019-04-04rpc: RPCHelpMan: Always push_name when outer type is an objectMarcoFalke