aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
AgeCommit message (Collapse)Author
2018-05-14Merge #12963: Fix Clang Static Analyzer warningsMarcoFalke
159c32d1f1 Add assertion to guide static analyzers. Clang Static Analyzer needs this guidance. (practicalswift) fd447a6efe Fix dead stores. Values were stored but never read. Limit scope. (practicalswift) Pull request description: Fix Clang Static Analyzer warnings reported by @kallewoof in #12961: * Fix dead stores. Values were stored but never read. * Add assertion to guide static analyzers. See #12961 for details. Tree-SHA512: 83dbec821f45217637316bee978e7543f2d2caeb7f7b0b3aec107fede0fff8baa756da8f6b761ae0d38537740839ac9752f6689109c38a4b05c0c041aaa3a1fb
2018-05-14Merge #13116: Add Clang thread safety annotations for variables guarded by ↵MarcoFalke
cs_{rpcWarmup,nTimeOffset,warnings} 8499f15e67 Add Clang thread safety annotations for variables guarded by cs_warnings (practicalswift) cf13ad23d4 Add Clang thread safety annotations for variables guarded by cs_nTimeOffset (practicalswift) 012dec0347 Add Clang thread safety annotations for variables guarded by cs_rpcWarmup (practicalswift) Pull request description: Add Clang thread safety annotations for variables guarded by `cs_{rpcWarmup,nTimeOffset,warnings}`. Tree-SHA512: 8e0a4b9e36a4450bd75ad32c21d813bb572aaaa5b4a4cbdcbf4678e58ade6265c0b275352391168930a63fcbd09caa3b76e74595a7b14646054c52870c46d007
2018-05-14Merge #12560: [wallet] Upgrade path for non-HD wallets to HDWladimir J. van der Laan
a8da482 Bump wallet version for pre split keypool (Andrew Chow) dfcd9f3 Use a keypool of presplit keys after upgrading to hd chain split (Andrew Chow) 5c50e93 Allow -upgradewallet to upgradewallets to HD (Andrew Chow) 2bcf2b5 Test sethdseed (Andrew Chow) b5ba01a Add 'sethdseed' RPC to initialize or replace HD seed (Chris Moore) dd3c07a Separate HaveKey function that checks whether a key is in a keystore (Andrew Chow) Pull request description: Revival/rebase of #11085 Adds a new command `sethdseed` which allows you to either set or generate a new HD seed to be used. A new keypool can be generated or the original one kept and new keys added to the keypool will come from the new HD seed. Wallets that are not HD will be upgraded to be version FEATURE_HD_SPLIT when the `sethdseed` RPC command is used. I have also add some tests for this. Additionally `-upgradewallet` can now be used to upgrade a wallet from non-HD to HD. When it is used for such an upgrade, the keypool will be regenerated. Tree-SHA512: e56c792e150590429ac4a1061e8d6f7b20cca06366e184eb9bbade4cd6ae82699a28fe84f87031eadba97ad2c1606517a105f00fb7b45779c979243020071adb
2018-05-12Add 'sethdseed' RPC to initialize or replace HD seedChris Moore
2018-05-07RPC Docs: gettxout*: clarify bestblock and unspent countsDavid A. Harding
2018-05-05Add compile time checking for all ::mempool.cs runtime locking assertionspracticalswift
2018-05-03Make it clear which functions that are intended to be translation unit localpracticalswift
Do not share functions that are meant to be translation unit local with other translation units. Use internal linkage for those consistently.
2018-05-02Add missing newlines to LogPrint debug loggingWladimir J. van der Laan
The linter only checked `LogPrintf`, not `LogPrint`. Fix the remaining cases.
2018-04-30Merge #12954: util: Refactor logging code into a global objectPieter Wuille
8c2d695c4a util: Store debug log file path in BCLog::Logger member. (Jim Posen) 8e7b961388 scripted-diff: Rename BCLog::Logger member variables. (Jim Posen) 1eac317f25 util: Refactor GetLogCategory. (Jim Posen) 3316a9ebb6 util: Encapsulate logCategories within BCLog::Logger. (Jim Posen) 6a6d764ca5 util: Move debug file management functions into Logger. (Jim Posen) f55f4fcf05 util: Establish global logger object. (Jim Posen) Pull request description: This is purely a refactor with no behavior changes. This creates a new class `BCLog::Logger` to encapsulate all global logging configuration and state. Tree-SHA512: b34811f54a53b7375d7b6f84925453c6f2419d21179379ee28b3843d0f4ff8e22020de84a5e783453ea927e9074e32de8ecd05a6fa50d7bb05502001aaed8e53
2018-04-30nit: fix typo for entry description stringmryandao
2018-04-29util: Refactor GetLogCategory.Jim Posen
Changing parameter types from pointers to references and uint32_t to BCLog::LogFlags simplies calling code.
2018-04-29Add Clang thread safety annotations for variables guarded by cs_rpcWarmuppracticalswift
2018-04-27util: Encapsulate logCategories within BCLog::Logger.Jim Posen
2018-04-27rpc: Move RPC_FORBIDDEN_BY_SAFE_MODE code to reserved sectionWladimir J. van der Laan
Although this code is no longer ever sent back after removing safe mode, it would be unwise to remove it from the header. For one, it would be bad to accidentally re-use the number. Also some API documentation / bindings are directly generated from the .h file - this is why the "Aliases for backward compatibility" are there. We don't want to break code that relies on this error code existing, even if it's never generated. So keep it around but move it to a reserved section.
2018-04-26Remove Safe modeAndrew Chow
2018-04-26Merge #12321: p2wsh and p2sh-p2wsh address in decodescriptWladimir J. van der Laan
41ff967 list the types of scripts we should consider for a witness program (fivepiece) 4f933b3 p2wpkh, p2wsh and p2sh-nested scripts in decodescript (fivepiece) Pull request description: Attempts to address #12244 . `p2wsh` addresses are returned only for scripts that are neither `p2sh` nor any witness program. Tree-SHA512: eb47f094c1a4c2ad2bcf27a8032307e43cf787d50bf739281aeb4101d97316a2f307b05118bf138298c937fa34e15f91436443a9b313f809fad2c43e94cd1831
2018-04-26Merge #12240: [rpc] Introduced a new `fees` structure that aggregates all ↵Wladimir J. van der Laan
sub-field fee types denominated in BTC 7de1de7 Add new fee structure with all sub-fields denominated in BTC (mryandao) Pull request description: the denomination for `fee` is current in btc while the other such as `decendentFee` and `ancestorFee` are in satoshis. Tree-SHA512: e428f6dca1d339f89ab73e38ce5903f5465c46b159069d9bcc3f8b1140fe6657fa49a11abe0088e9f7ba9999f64af72a349a4735bf5eaa61b8e4a185b23543f3
2018-04-25[rpc] Public interfaces to GetTransaction block until synced.Jim Posen
Now that the transaction index is updated asynchronously, in order to preserve the current behavior of public interfaces, the code blocks until the transaction index is caught up with the current state of the blockchain.
2018-04-25[validation] Replace tx index code in validation code with TxIndex.Jim Posen
2018-04-23Merge #12448: Interrupt block generation on shutdown requestWladimir J. van der Laan
0851a75 rpc: Interrupt block generation on shutdown request (João Barbosa) Pull request description: With this simple change, after running `bitcoin-cli -regtest generate 100000`, it is possible to interrupt `bitcoind` cleanly without waiting for the generation to complete. Tree-SHA512: f0f7cdde242e595cfdaea31ae8bddbc25933621b63f639e813d272c2b00ce2ef52f0c14ae44954ba8c49f0fc846bcc3bfd5419e52b3347a68bb0341ce6b02d26
2018-04-18wallet: Add HasWalletsJoão Barbosa
2018-04-18wallet: Add AddWallet, RemoveWallet, GetWallet and GetWalletsJoão Barbosa
With these new functions all vpwallets usage are removed and vpwallets is now a static variable (no external linkage).
2018-04-18Add new fee structure with all sub-fields denominated in BTCmryandao
2018-04-13Expose a transaction's weight via RPCMatt Corallo
2018-04-12Merge #12743: Fix csBestBlock/cvBlockChange waiting in rpc/miningPieter Wuille
4a6c0e3dcf Modernize best block mutex/cv/hash variable naming (Pieter Wuille) 45dd135039 Fix csBestBlock/cvBlockChange waiting in rpc/mining (Pieter Wuille) Pull request description: This is an alternative to #11694. It reintroduces a uint256 variable with the best block hash, protected by csBestBlock, and only updated while holding it. Also rename the involved variable to modern guidelines, as there are very few uses. Tree-SHA512: 826a86c7d3cee7fe49f99f4398ae99e81cb0563197eaeba77306a3ca6072b67cdb932bc35720fc0f99c2a57b218efa029d0b8bdfb240591a629b2e90efa3199d
2018-04-12Merge #12803: Make BaseSignatureCreator a pure interfaceWladimir J. van der Laan
be67831 Make DummySignatureCreator a singleton (Pieter Wuille) 190b8d2 Make BaseSignatureCreator a pure interface (Pieter Wuille) Pull request description: * Removes the `m_provider` field from `BaseSignatureCreator`. Instead both a `SigningProvider` (which provides keys and scripts) and a `BaseSignatureCreator` (which implements the transaction-specific (or other) signing logic) are passed into and down in `ProduceSignature`, making the two concepts orthogonal. * Makes `BaseSignatureCreator` a pure interface without constructor, making it easier to implement new derivations of it (for example for message signing). * As `DummySignatureCreator` now becomes a stateless object, turn it into a singleton `DUMMY_SIGNATURE_CREATOR`. Tree-SHA512: 5f1f4512e4ea7d02a31df7b9ede55008efa716c5b74a2630ca1c2fc6599584d8bf5f5641487266127f4b3788033803539fbd22b03ef1219c83c10da2d3da3dcd
2018-04-12Add assertion to guide static analyzers. Clang Static Analyzer needs this ↵practicalswift
guidance.
2018-04-11rpc: Drop redundant testing of signrawtransaction prevtxs argsBen Woosley
These other types are already tested on line 736.
2018-04-10[wallet] [rpc] introduce 'label' API for walletWladimir J. van der Laan
Add label API to wallet RPC. This is one step towards #3816 ("Remove bolt-on account system") although it doesn't actually remove anything yet. These initially mirror the account functions, with the following differences: - These functions aren't DEPRECATED in the help - Help mentions 'label' instead of accounts. In the language used, labels are associated with addresses, instead of addresses associated with labels. (unlike with accounts.) - Labels have no balance - No balances in `listlabels` - `listlabels` has no minconf or watchonly argument - Like in the GUI, labels can be set on any address, not just receiving addreses - Unlike accounts, labels can be deleted. Being unable to delete them is a common annoyance (see #1231). Currently only by reassigning all addresses using `setlabel`, but an explicit call `deletelabel` which assigns all address to the default label may make sense. Thanks to Pierre Rochard for test fixes.
2018-04-10Make BaseSignatureCreator a pure interfacePieter Wuille
2018-04-09Merge #12007: [Doc] Clarify the meaning of fee delta not being a fee rate in ↵MarcoFalke
prioritisetransaction RPC c198dc00e1 [Doc] Clarify the meaning of fee delta not being a fee rate in prioritisetransaction RPC (Jan Čapek) Pull request description: Hi, I have faced some confusion among our developers considering this being a fee rate. Would you consider including this tiny doc update? Best regards, Jan Capek Tree-SHA512: cd0560540418e53c5c19ceab2d5aca229f4ef6b788b9543695742522e1c63a7f2cce2574b47fead098a106da2f77e297f0c728474565f6259b50d62369bbe7da
2018-04-08list the types of scripts we should consider for a witness programfivepiece
2018-04-07Merge #12860: Add testmempoolaccept to release-notes, Add missing constWladimir J. van der Laan
fafcad3 doc: Add testmempoolaccept to release-notes (MarcoFalke) Pull request description: Some fixups for #11742: * Add release notes for the new rpc * Fix a typo in the original pull * Make the mempool reference passed to `CheckInputsFromMempoolAndCache` const, since that function is called before we return from ATMP and we must not modify the mempool. Tree-SHA512: 72c459ba69f7698a69c91d2592f10f7fb1864846c7d8c525050d48286f92ba5ec5fe554c54235b52fbd9a8f00226c526ad84584641ec39084e1a1310a261510d
2018-04-05Merge #12859: Bugfix: Include <memory> for std::unique_ptrWladimir J. van der Laan
a5bca13 Bugfix: Include <memory> for std::unique_ptr (Luke Dashjr) Pull request description: Not sure why all these includes were missing, but it's breaking builds for some users: https://bugs.gentoo.org/show_bug.cgi?id=652142 (Added to all files with a reference to `std::unique_ptr`) Tree-SHA512: 8a2c67513ca07b9bb52c34e8a20b15e56f8af2530310d9ee9b0a69694dd05e02e7a3683f14101a2685d457672b56addec591a0bb83900a0eb8e2a43d43200509
2018-04-03Modernize best block mutex/cv/hash variable namingPieter Wuille
2018-04-03Fix csBestBlock/cvBlockChange waiting in rpc/miningPieter Wuille
2018-04-02Bugfix: Include <memory> for std::unique_ptrLuke Dashjr
2018-04-02doc: Add testmempoolaccept to release-notesMarcoFalke
2018-04-02Merge #11742: rpc: Add testmempoolacceptWladimir J. van der Laan
b55555d rpc: Add testmempoolaccept (MarcoFalke) Pull request description: To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo. The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state. Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
2018-04-01Merge #12757: Clarify include guard naming conventionMarcoFalke
3bcc0059b8 Add lint-include-guards.sh which checks include guard consistency (practicalswift) 8fd6af89a0 Fix missing or inconsistent include guards (practicalswift) 8af65d96f4 Document include guard convention (practicalswift) Pull request description: * **Documentation**: Document include guard convention * **Fix**: Fix missing or inconsistent include guards * **Regression test**: Add `lint-include-guards.sh` which checks include guard consistency Tree-SHA512: 8171878f60fd08ccbea943a11e835195750592abb9d7ab74eaa4265ae7fac523b1da9d31ca13d6ab73dd596e49986bfb7593c696e5f39567c93e610165bc2acc
2018-03-30Merge #12172: Bugfix: RPC: savemempool: Don't save until LoadMempool() is ↵Wladimir J. van der Laan
finished cb1e319 Bugfix: RPC: savemempool: Don't save until LoadMempool() is finished (Jorge Timón) Pull request description: Fixes https://github.com/bitcoin/bitcoin/issues/12142 The tests are a little bit slow, mempool_persist.py goes from about 20 s to about 120 s in my hardware. Perhaps there's a better way to test this. Tree-SHA512: 9e6c24b32a9cf3774e8f0bd81c035b0deb53fba5ac3eb2532d85900579d21cef8a1135b75a4fa0a9d883e3822eb35e7d4b47a0838abf99789039205041962629
2018-03-29Merge #12787: rpc: Adjust ifdef to avoid unreachable codeWladimir J. van der Laan
61f8298 rpc: Adjust ifdef to avoid unreachable code (practicalswift) Pull request description: Adjust `ifdef` to avoid unreachable code. Introduced in 1e79c055cd30d21ba5f8c7f81ef911d5d4e295a8. Tree-SHA512: c775cc9181e4034f26c5b219974e06886435275933249b169d2bc8bc98f639c4027e1e7d991f43bded62146a141acee6d3be1f2b313042d9bbc0a5d2e71d6c7c
2018-03-29Bugfix: RPC: savemempool: Don't save until LoadMempool() is finishedJorge Timón
2018-03-27Merge #12778: RPC: Add username and ip logging for RPC method requestsWladimir J. van der Laan
4d74c78 Add username and ip logging for RPC method requests (Gabriel Davidian) Pull request description: Adds username and IP logging (if enabled via -logips command) to RPC method request logging. This closes #12223 Tree-SHA512: a441228e80ea6884ec379c66e949d86df3689770f1b3c3608015cf5a36d2dfb38051298a7f6ea6dfdfbf0b3b6c896e414c8dc54e9833bb73dd65bdb1832f4395
2018-03-27Merge #10742: scripted-diff: Use scoped enumerations (C++11, "enum class")Wladimir J. van der Laan
1f45e21 scripted-diff: Convert 11 enums into scoped enums (C++11) (practicalswift) Pull request description: Rationale (from Bjarne Stroustrup's ["C++11 FAQ"](http://www.stroustrup.com/C++11FAQ.html#enum)): > > The enum classes ("new enums", "strong enums") address three problems with traditional C++ enumerations: > > * conventional enums implicitly convert to int, causing errors when someone does not want an enumeration to act as an integer. > * conventional enums export their enumerators to the surrounding scope, causing name clashes. > * the underlying type of an enum cannot be specified, causing confusion, compatibility problems, and makes forward declaration impossible. > > The new enums are "enum class" because they combine aspects of traditional enumerations (names values) with aspects of classes (scoped members and absence of conversions). Tree-SHA512: 9656e1cf4c3cabd4378c7a38d0c2eaf79e4a54d204a3c5762330840e55ee7e141e188a3efb2b4daf0ef3110bbaff80d8b9253abf2a9b015cdc4d60b49ac2b914
2018-03-26rpc: Adjust ifdef to avoid unreachable codepracticalswift
2018-03-25Add username and ip logging for RPC method requestsGabriel Davidian
2018-03-24rpc: Add testmempoolacceptMarcoFalke
2018-03-22Merge #11536: Rename account to label where appropriateWladimir J. van der Laan
d2527bd Rename wallet_accounts.py test (Russell Yanofsky) 045eeb8 Rename account to label where appropriate (Russell Yanofsky) Pull request description: Rename account to label where appropriate This change only updates strings and adds RPC aliases, but should simplify the implementation of address labels in https://github.com/bitcoin/bitcoin/pull/7729, by getting renaming out of the way and letting that change focus on semantics. The difference between accounts and labels is that labels apply only to addresses, while accounts apply to both addresses and transactions (transactions have "from" and "to" accounts). The code associating accounts with transactions is clumsy and unreliable so we would like get rid of it. --- There is a rebased version of #7729 atop this PR at https://github.com/ryanofsky/bitcoin/commits/pr/label, see https://github.com/bitcoin/bitcoin/pull/7729#issuecomment-338417139. Tree-SHA512: b3f934e612922d6290f50137f8ba71ddfaea4485713c7d97e89400a8b73b09b254f9186dffa462c77f5847721f5af9852b5572ade5443d8ee95dd150b3edb7ff
2018-03-22Fix missing or inconsistent include guardspracticalswift