aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
AgeCommit message (Collapse)Author
2019-02-11Factor BroadcastTransaction out of sendrawtransactionGlenn Willen
Factor out a new BroadcastTransaction function, performing the core work of the sendrawtransaction rpc, so that it can be used from the GUI code. Move it from src/rpc/ to src/node/.
2019-02-11Split DecodePSBT into Base64 and Raw versionsGlenn Willen
Split up DecodePSBT, which both decodes base64 and then deserializes a PartiallySignedTransaction, into two functions: DecodeBase64PSBT, which retains the old behavior, and DecodeRawPSBT, which only performs the deserialization. Add a test for base64 decoding failure.
2019-02-11RPCHelpMan: Check default values are given at compile-timeMarcoFalke
2019-02-11Merge #15373: Move ParseConfirmTarget from rpc/mining to rpc/utilMarcoFalke
50e647210d Move ParseConfirmTarget from rpc/mining to rpc/util (Russell Yanofsky) Pull request description: Util is a better home since it's called both by wallet and mining code. Suggested https://github.com/bitcoin/bitcoin/pull/15288#discussion_r254449444 Tree-SHA512: 4320caf2a3f70d2885c421de04f2ec68ff3f6519258c5155fc46e245dc1765fd15c81f260af5096318f24ff9deb88fc3c5ef40eec8b7393f467f5b963d17215b
2019-02-11Merge #15337: rpc: Fix for segfault if combinepsbt called with empty inputsMarcoFalke
30d0f7be6e rpc: Fix for segfault if combinepsbt called with empty inputs (benthecarman) Pull request description: Fixes #15300 Tree-SHA512: 25e7b4e6e48d8b0d197f0ab96df308fff33e2110f8929cb48914877fa7f4c4a84f173b1378fdb2dec5d03fe7d6d1aced4b577e55f9fe180d8147d9106ebf543f
2019-02-11Merge #15226: Allow creating blank (empty) wallets (alternative)MeshCollider
7687f7873 [wallet] Support creating a blank wallet (Andrew Chow) Pull request description: Alternative (kind of) to #14938 This PR adds a `blank` parameter to the `createwallet` RPC to create a wallet that has no private keys initially. `sethdseed` can then be used to make a clean wallet with a custom seed. `encryptwallet` can also be used to make a wallet that is born encrypted. Instead of changing the version number as done in #14938, a wallet flag is used to indicate that the wallet should be blank. This flag is set at creation, and then unset when the wallet is no longer blank. A wallet becomes non-blank when a HD seed is set or anything is imported. The main change to create a blank wallet is primarily taken from #14938. Also with this, the term "blank wallet" is used instead of "empty wallet" to avoid confusion with wallets that have balance which would also be referred to as "empty". This is built on top of #15225 in order to fix GUI issues. Tree-SHA512: 824d685e11ac2259a26b5ece99c67a7bda94a570cd921472c464243ee356b7734595ad35cc439b34357135df041ed9cba951e6edac194935c3a55a1dc4fcbdea
2019-02-10[wallet] Support creating a blank walletAndrew Chow
A blank wallet is a wallet that has no keys, script or watch only things. A new wallet flag indicating that it is blank will be set when the wallet is blank. Once it is no longer blank (a seed has been generated, keys or scripts imported, etc), the flag will be unset.
2019-02-08Move ParseConfirmTarget from rpc/mining to rpc/utilRussell Yanofsky
Util is a better home since it's called both by wallet and mining code. Suggested https://github.com/bitcoin/bitcoin/pull/15288#discussion_r254449444
2019-02-08Merge #14667: Add deriveaddresses RPC util methodMeshCollider
595283851 [rpc] util: add deriveaddresses method (Sjors Provoost) Pull request description: Usage: ```sh bitcoin-cli deriveaddresses "wpkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/0)" [ "bc1qg6ucjz7kgdedam7v5yarecy54uqw82yym06z3q" ] // part of the BIP32 test vector ``` Avoids the need for external (BIP32) libraries to derive an address. Can be used in conjunction with `scantxoutset` as a poor mans wallet. Might be useful to test more complicated future descriptors. ~To keep it as simple as possible it only supports descriptors that result in a single address, so no `combo()` and ranges.~ As discussed recently on IRC it might make sense to put this in a separate utility along with other descriptor and psbt utility functions which don't need a chain or wallet context. However I prefer to leave that to another PR. Tree-SHA512: b8e53db11a8fd87638cc98766270cc3be9adc4b3e5085798a6a4e2e6ad252bf6d2189346bbb2da72d04d13f7f1e80b5cb88e8039653bea1f150602a876ef7f34
2019-02-05Merge #15332: [Docs] Small updates to getrawtransaction descriptionMarcoFalke
47012391ec [Docs] Small updates to getrawtransaction description (Amiti Uttarwar) Pull request description: As per review comments on https://github.com/bitcoin/bitcoin/pull/15159 Tree-SHA512: 0bbbe956b47d177f7e67c5ab2048287783327d9e07a679d64d79aee3ea8633e769f75b59d3dbce517924ba5d64d6c44f26bf49e16d40612463e460ad1a238129
2019-02-05Merge #15245: remove deprecated mentions of signrawtransaction from fundraw helpMarcoFalke
851380ce17 remove deprecated mentions of signrawtransaction from fundraw help (Gregory Sanders) Pull request description: RPC call has been removed as of 0.17.99. Tree-SHA512: a6a12a0e4572acd9b532c1719be85ed6f29d1c1a28f9ce691398528b8dde4fb4a3222b8f68632fcb1a8eddfe2d31e96d5efd5bc51c041af8e7cb99b61ca3a167
2019-02-04rpc: Fix for segfault if combinepsbt called with empty inputsbenthecarman
2019-02-04Merge #15266: memory: Construct globals on first useMarcoFalke
77777c5624 log: Construct global logger on first use (MarcoFalke) Pull request description: The (de)initialization order is not well defined in C++, so generally it is not safe to use globals as the (de/con)structor of one global could use the (de/con)structor of another global before/after it has been (con/de)structed. Specifically this fixes: * `g_logger` might not be initialized on the first use, so do that. (Fixes #15111) Tree-SHA512: eb9c22f4baf31ebc5b0b9ee6a51d1354bae1f0df186cc0ce818b4483c7b5a7f90268d2b549ee96b4c57f8ef36ab239dc6497f74f3e2ef166038f7437c368297d
2019-02-04[Docs] Small updates to getrawtransaction descriptionAmiti Uttarwar
2019-02-04remove deprecated mentions of signrawtransaction from fundraw helpGregory Sanders
2019-01-31Merge #15272: doc: correct logging return type and RPC exampleWladimir J. van der Laan
e1c27da30378940095806b2bf9989b162ed8ac07 doc: correct logging rpc return type and example (fanquake) Pull request description: Logging status is returned as a bool. ``` src/bitcoin-cli logging "[\"all\"]" "[\"http\"]" { "net": true, "tor": true, "mempool": true, "http": false, "bench": true, "zmq": true, "db": true, "rpc": true, "estimatefee": true, "addrman": true, "selectcoins": true, "reindex": true, "cmpctblock": true, "rand": true, "prune": true, "proxy": true, "mempoolrej": true, "libevent": true, "coindb": true, "qt": true, "leveldb": true } ``` Also corrects the RPC example so that `libevent` logging will actually be turned off. Tree-SHA512: 2de7130df51688d2d6636c12fd56326362794118a10efc8100f0bf541a7da00a12a6cd9d75e599a104513a050bbe49b418ea460ee8033ac6cf6ffb8e8e9140d6
2019-01-30Merge #15159: [RPC] Remove lookup to UTXO set from GetTransactionMarcoFalke
04da9f4834 [RPC] Update getrawtransaction interface (Amiti Uttarwar) Pull request description: - stop checking unspent UTXOs for a transaction when txindex is not enabled, as per conversation here: https://github.com/bitcoin/bitcoin/issues/3220#issuecomment-377458383 - code contributed by sipa Tree-SHA512: aa07353bccc14b81b7803992a25d076d6bc06d15ec7c1b85828dc10aea7e0498d9b49f71783e352ab8a14b0bb2010cfb7835de3dfd1bc6f2323f460449348e66
2019-01-29log: Construct global logger on first useMarcoFalke
2019-01-29[rpc] util: add deriveaddresses methodSjors Provoost
2019-01-29doc: correct logging rpc return type and examplefanquake
2019-01-29Merge #14987: RPCHelpMan: Pass through Result and ExamplesMarcoFalke
faa1522e5e RPCHelpMan: Pass through Result and Examples (MarcoFalke) Pull request description: Passing the rpc result and rpc examples through `RPCHelpMan` makes it clear in what order they appear in the stringified version. Future improvements could then autoformat or autogenerate them. Tree-SHA512: b32a5c178cc80f50a7e9b93a38e2b26d5994188ecafe9e61bbc599941b44b9b0e4e4be6413d4464fac6e8e73661a191a77d34917f2e6293de19fb59519dd4487
2019-01-28Merge #15248: rpc: Compile on GCC4.8MarcoFalke
fa5f890aeb rpc: Compile on GCC4.8 (MarcoFalke) Pull request description: GCC 4.8 is lacking some C++11 signatures (see "Adjust C++11 signatures to take a const_iterator." in GCC 4.9: https://github.com/gcc-mirror/gcc/commit/3d2b2f494d78e0f4168d2c7ba5a76c05b4f4af71) Fix that by changing the code to use the pre-GCC 4.9 signature. Can be reverted after #13356. Fixes #15172 (reports on `Linux Mint 17.3 Rosa` and `CentOS Linux release 7.5.1804 (Core)`) Tree-SHA512: 0c0b18968270ad4fcd0c2000c57485be881a461135dac3ad0bdab22c1a2292cf6b28ebeb930ccaa0290ff20ce87547fd07ab8189c4c4fb54d652a3d0bc9615f8
2019-01-27rpc: Compile on GCC4.8MarcoFalke
2019-01-26[RPC] Update getrawtransaction interfaceAmiti Uttarwar
2019-01-25RPCHelpMan: Pass through Result and ExamplesMarcoFalke
2019-01-21Merge #14906: refactor: Make explicit CMutableTransaction -> CTransaction ↵Wladimir J. van der Laan
conversion. b301950df32443e358bc22ca22c6f9ac09d18219 Made expicit constructor CTransaction(const CMutableTransaction &tx). (lucash-dev) faf29dd019efef4b05e8e78885926764134d9c04 Minimal changes to comply with explicit CMutableTransaction -> CTranaction conversion. (lucash-dev) Pull request description: This PR is re-submission of #14156, which was automatically closed by github (glitch?) Original description: This PR makes explicit the now implicit conversion constructor `CTransaction(const CMutableTransaction&)` in `transaction.h`. Minimal changes were made elsewhere to make the code compilable. I'll follow up with other PRs to address individually refactoring functions that should have a `CMutableTransaction` version, or where a `CTransaction` should be reused. The rationale for this change is: - Conversion constructors should not be explicit unless there's a strong reason for it (in the opinion of, for example, https://google.github.io/styleguide/cppguide.html, and https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Ro-conversion. Let me know your take on this). - This particular conversion is very costly -- it implies a serialization plus hash of the transaction. - Even though `CTransaction` and `CMutableTransaction` represent the same data, they have very different use cases and performance properties. - Making it explicit allows for easier reasoning of performance trade-offs. - There has been previous performance issues caused by unneeded use of this implicit conversion. - This PR creates a map for places to look for possible refactoring and performance gains (this benefit still holds if the PR is not merged). Tree-SHA512: 2427462e7211b5ffc7299dae17339d27f8c43266e0895690fda49a83c72751bd2489d4471b3993075a18f3fef25d741243e5010b2f49aeef4a9688b30b6d0631
2019-01-16net: move BanMan to its own filesCory Fields
2019-01-16banman: create and split out banmanCory Fields
Some say he has always been.
2019-01-16net: Break disconnecting out of Ban()Cory Fields
These are separate events which need to be carried out by separate subsystems. This also cleans up some whitespace and tabs in qt to avoid getting flagged by the linter. Current behavior is preserved.
2019-01-14Merge #14982: rpc: Add getrpcinfo commandWladimir J. van der Laan
a0ac15459a0df598e1ee1fd36a3899a129cecaeb doc: Add getrpcinfo release notes (João Barbosa) 251a91c1bf245b3674c2612149382a0f1e18dc98 qa: Add tests for getrpcinfo (João Barbosa) d0730f5ce475e5a84da7c61fe79bcd6ed24d693e rpc: Add getrpcinfo command (João Barbosa) 068a8fc05f8dbec198bdc3fe46f955d8a5255303 rpc: Track active commands (João Barbosa) bf4383277d6761cc5b7a91975752c08df829af72 rpc: Remove unused PreCommand signal (João Barbosa) Pull request description: The new `getrpcinfo` command exposes details of the RPC interface. The details can be configuration properties or runtime values/stats. This can be particular useful to coordinate concurrent functional tests (see #14958 from where this was extracted). Tree-SHA512: 7292cb6087f4c429973d991aa2b53ffa1327d5a213df7d6ba5fc69b01b2e1a411f6d1609fed9234896293317dab05f65064da48b8f2b4a998eba532591d31882
2019-01-13Drop IsLimited in favor of IsReachableBen Woosley
These two methods have had the same meaning, but inverted, since 110b62f06992d0fb989153afff2dc3aea62a674f. Having one name for a single concept simplifies the code.
2019-01-08Merge #12153: Avoid permanent cs_main lock in getblockheaderWladimir J. van der Laan
f12e1d0b5117e3688f52a25ed0170d76ecdbf233 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa) Pull request description: This PR reduces the `cs_main` lock scope in `getblockheader` RPC. Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
2019-01-07Merge #15057: [rpc] Correct reconsiderblock help text, add testWladimir J. van der Laan
fa38d3df69851212fea7544badadc1c3e5369bf5 [rpc] Correct reconsiderblock help text, add test (MarcoFalke) Pull request description: Rework documentation and test to match the implementation Tree-SHA512: d0adef6b054a341bcc1cb87783a4e4cf9be124ba6812e1ac88246a5e01b2861a8071b12dba880b2b428c37da3fa860bfec3fe3e5fbb7c28696872113faa84a9f
2019-01-07Merge #15078: rpc: Document bytessent_per_msg and bytesrecv_per_msgWladimir J. van der Laan
fab3f1467823c854cc88bc5a7e087263866ed87e rpc: Document bytessent_per_msg and bytesrecv_per_msg (MarcoFalke) Pull request description: Tree-SHA512: 11af7502933b3dae203d90e36b35019e0ebe67ee09aa77360a27547487bd2b6bcaa18c5f60bc21966291d2ccf44dfedebf40103c4db70a359400f535a66abb23
2019-01-04rpc: Avoid permanent cs_main lock in getblockheaderJoão Barbosa
2019-01-04Merge #12151: rpc: Remove cs_main lock from blockToJSON and blockheaderToJSONMarcoFalke
b9f226b41f rpc: Remove cs_main lock from blockToJSON and blockHeaderToJSON (João Barbosa) 343b98cbcd rpc: Specify chain tip instead of chain in GetDifficulty (João Barbosa) 54dc13b6a2 rpc: Fix SoftForkMajorityDesc and SoftForkDesc signatures (João Barbosa) Pull request description: Motivated by https://github.com/bitcoin/bitcoin/pull/11913#discussion_r157798157, this pull makes `blockToJSON` and `blockheaderToJSON` free of `cs_main` locks. Locking `cs_main` was required to access `chainActive` in order to check if the block was in the chain and to retrieve the next block index. With the this approach, `CBlockIndex::GetAncestor()` is used in a way to check if the block belongs to the specified chain tip and, at the same time, get the next block index. Tree-SHA512: a6720ace0182c19033bbed1a404f729d793574db8ab16e0966ffe412145611e32c30aaab02975d225df6d439d7b9ef2070e732b16137a902b0293c8cddfeb85f
2019-01-03rpc: Document bytessent_per_msg and bytesrecv_per_msgMarcoFalke
2019-01-02rpc: Add getrpcinfo commandJoão Barbosa
2019-01-02rpc: Track active commandsJoão Barbosa
2019-01-01[rpc] Correct reconsiderblock help text, add testMarcoFalke
2018-12-29Merge #13743: refactor: Replace boost::bind with std::bindMarcoFalke
cb53b825c2 scripted-diff: Replace boost::bind with std::bind (Chun Kuan Lee) 2196c51821 refactor: Use boost::scoped_connection in signal/slot, also prefer range-based loop instead of std::transform (Chun Kuan Lee) Pull request description: Replace boost::bind with std::bind - In `src/rpc/server.cpp`, replace `std::transform` with simple loop. - In `src/validation.cpp`, store the `boost::signals2::connection` object and use it to disconnect. - In `src/validationinterface.cpp`, use 2 map to store the `boost::signals2::scoped_connection` object. Tree-SHA512: 6653cbe00036fecfc495340618efcba6d7be0227c752b37b81a27184433330f817e8de9257774e9b35828026cb55f11ee7f17d6c388aebe22c4a3df13b5092f0
2018-12-29Merge #14966: docs: fix testmempoolaccept CLI syntaxMarcoFalke
b74a52192b fix testmempoolaccept CLI syntax (1Il1) Pull request description: `testmempoolaccept "hexstring"` will give a "JSON parse error". The correct syntax is `testmempoolaccept \[\"hexstring\"\]` (but seems escaping is not displayed in other areas so leaving backspaces out). Tree-SHA512: ad755147d6db0bd3f2d8481517dab29df755a32b28a3bdb4553b1fddd1940850450d1e9a6c3bd04e4e3faa7bc09aadfd3412b4cd65e61d61ea34452831597967
2018-12-28Merge #14981: rpc: Clarifying RPC getrawtransaction's time help textMarcoFalke
84104c781a clarifying getrawtransaction[time] get help text (Ben Carman) Pull request description: #12339 The `time` and `blocktime` entries have the same value so they should have the same help text as well Tree-SHA512: 1e9a94678eec8501c761f16bf3d8e269d68620596d1fdd31a32989a1b53be5a8097ece8bfabe99979e658dec82237e37d8194ae2acd7c1deef7501ee701667fb
2018-12-21Merge #14811: Mining: Enforce that segwit option must be set in GBTMarcoFalke
d2ce315fbf [docs] add release note for change to GBT (John Newbery) 0025c9eae4 [mining] segwit option must be set in GBT (John Newbery) Pull request description: Calling getblocktemplate without the segwit rule specified is most likely a client error, since it results in lower fees for the miner. Prevent this client error by failing getblocktemplate if called without the segwit rule specified. Of the previous 1000 blocks (measured at block [551591 (hash 0x...173c811)](https://blockstream.info/block/000000000000000000173c811e79858808abc3216af607035973f002bef60a7a)), 991 included segwit transactions. Tree-SHA512: 7933b073d72683c9ab9318db46a085ec19a56a14937945c73f783ac7656887619a86b74db0bdfcb8121df44f63a1d6a6fb19e98505b2a26a6a8a6e768e442fee
2018-12-19Merge #14993: rpc: Fix data race (UB) in InterruptRPC()Wladimir J. van der Laan
6c10037f72073eecc674c313580ef50a4f1e1e44 rpc: Fix data race (UB) in InterruptRPC() (practicalswift) Pull request description: Fix data race (UB) in `InterruptRPC()`. Before: ``` $ ./configure --with-sanitizers=thread $ make $ test/functional/test_runner.py feature_shutdown.py … SUMMARY: ThreadSanitizer: data race rpc/server.cpp:314 in InterruptRPC() … ALL | ✖ Failed | 2 s (accumulated) ``` After: ``` $ ./configure --with-sanitizers=thread $ make $ test/functional/test_runner.py feature_shutdown.py … ALL | ✓ Passed | 3 s (accumulated) ``` Tree-SHA512: b139ca1a0480258f8caa7730cabd7783a821d906630f51487750a6b15b7842675ed679747e1ff1bdade77d248807e9d77bae7bb88da54d1df84a179cd9b9b987
2018-12-18rpc: Fix data race (UB) in InterruptRPC()practicalswift
2018-12-17 Minimal changes to comply with explicit CMutableTransaction -> CTranaction ↵lucash-dev
conversion. This commit makes the minimal changes necessary to fix compilation once CTransaction(const CMutableTransaction &tx) is made explicit. In each case an explicit call `CTransaction(...)` was added. Shouldn't affect behaviour or performance.
2018-12-17clarifying getrawtransaction[time] get help textBen Carman
2018-12-15fix testmempoolaccept CLI syntax1Il1
`testmempoolaccept "hexstring"` will give a "JSON parse error". The correct syntax is `testmempoolaccept \[\"hexstring\"\]` (but seems escaping is not displayed in other areas so leaving backspaces out).
2018-12-14rpc: Remove unused PreCommand signalJoão Barbosa