aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
AgeCommit message (Collapse)Author
2020-04-07Merge #18532: rpc: Avoid initialization-order-fiasco on static CRPCCommand ↵MarcoFalke
tables fa1a92224dd78de817d15bcda35a8310254e1a54 rpc: Avoid initialization-order-fiasco on static CRPCCommand tables (MarcoFalke) Pull request description: Currently the fiasco is only theoretical because all content of the table are compile-time constants. However, the fiasco materializes should they ever become run-time constants (e.g. #18531). ACKs for top commit: promag: ACK fa1a92224dd78de817d15bcda35a8310254e1a54. practicalswift: ACK fa1a92224dd78de817d15bcda35a8310254e1a54 -- fiasco bad :) Tree-SHA512: cccadb0ad56194599b74f04264d74c34fa865958580a850efc6474bbdc56f30cadce6b2e9a6ad5472ff46c3f4c793366acd8090fad409a45b25d961f2d89da19
2020-04-06Wallet: Replace CAddressBookData.name with GetLabel() methodLuke Dashjr
2020-04-07Merge #18192: Bugfix: Wallet: Safely deal with change in the address bookMarcoFalke
b5795a788639305bab86a8b3f6b75d6ce81be083 Wallet: Add warning comments and assert to CWallet::DelAddressBook (Luke Dashjr) 6d2905f57aaeb3ec3b63d31043f7673ca10003f2 Wallet: Avoid unnecessary/redundant m_address_book lookups (Luke Dashjr) c751d886f499257627b308b11ffaa51c22db6cc0 Wallet: Avoid treating change-in-the-addressbook as non-change everywhere (Luke Dashjr) 8e64b8c84bcbd63caea06f3af087af1f0609eaf5 Wallet: New FindAddressBookEntry method to filter out change entries (and skip ->second everywhere) (Luke Dashjr) 65b6bdc2b164343ec3cc3d32a0297daff9e24fec Wallet: Add CAddressBookData::IsChange which returns true iff label has never been set (Luke Dashjr) 144b2f85da4d51bf7d72b987888ddcaf5b429eed Wallet: Require usage of new CAddressBookData::setLabel to change label (Luke Dashjr) b86cd155f6f661052042048aa7cfc2a397afe4f7 scripted-diff: Wallet: Rename mapAddressBook to m_address_book (Luke Dashjr) Pull request description: In many places, our code assumes that presence in the address book indicates a non-change key, and absence of an entry in mapAddressBook indicates change. This no longer holds true after #13756 (first released in 0.19) since it added a "used" DestData populated even for change addresses. Only avoid-reuse wallets should be affected by this issue. Thankfully, populating DestData does not write a label to the database, so we can retroactively fix this (so long as the user didn't see the change address and manually assign it a real label). Fixing it is accomplished by: * Adding a new bool to CAddressBookData to track if the label has ever been assigned, either by loading one from the database, or by assigning one at runtime. * `CAddressBookData::IsChange` and `CWallet::FindAddressBookEntry` are new methods to assist in excluding change from code that doesn't expect to see them. * For safety in merging, `CAddressBookData::name` has been made read-only (the actual data is stored in `m_label`, a new private member, and can be changed only with `setLabel` which updates the `m_change` flag), and `mapAddressBook` has been renamed to `m_address_book` (to force old code to be rebased to compile). A final commit also does some minor optimisation, avoiding redundant lookups in `m_address_book` when we already have a pointer to the `CAddressBookData`. ACKs for top commit: ryanofsky: Code review ACK b5795a788639305bab86a8b3f6b75d6ce81be083. Pretty clever and nicely implemented fix! jonatack: ACK b5795a788639305bab86a8b3f6b75d6ce81be083 nice improvements -- code review, built/ran tests rebased on current master ff53433fe4ed06893d7c4 and tested manually with rpc/cli jnewbery: Good fix. utACK b5795a788. Tree-SHA512: 40525185a0bcc1723f602243c269499ec86ecb298fecb5ef24d626bbdd5e3efece86cdb1084ad7eebf7eeaf251db4a6e056bcd25bc8457b417fcbb53d032ebf0
2020-04-06Merge #18487: rpc: Fix rpcRunLater race in walletpassphraseWladimir J. van der Laan
7b8e15728d1ad058a4b7d7569fd5d5ba6806ca28 rpc: Fix rpcRunLater race in walletpassphrase (João Barbosa) Pull request description: Release locks before calling `rpcRunLater`. Quick explanation: `rpcRunLater` leads to `event_free` which calls `event_del` which can wait for the event callback to finish if it's already running and that callback will try to lock wallet mutex - which is already locked in http thread. Fixes #14995 , fixes #18482. Best reviewed with whitespace changes hidden. ACKs for top commit: MarcoFalke: ACK 7b8e15728d, only tested that this avoids the node freezing. Did not look at how libevent works or how the deadlock happens or if this breaks other stuff. 📞 ryanofsky: Code review ACK 7b8e15728d1ad058a4b7d7569fd5d5ba6806ca28. Just updated comment since last review Tree-SHA512: 17874a2fa7b0e164fb0d7ee4cb7d59650275b8c03476fb291d60af8b758495457660d3912623fb26259fefe84aeba21c0a9e0c6467982ba511f19344ed5413ab
2020-04-06rpc: Avoid initialization-order-fiasco on static CRPCCommand tablesMarcoFalke
2020-04-02Wallet: Avoid unnecessary/redundant m_address_book lookupsLuke Dashjr
2020-04-02rpc: Fix rpcRunLater race in walletpassphraseJoão Barbosa
2020-04-02Wallet: Avoid treating change-in-the-addressbook as non-change everywhereLuke Dashjr
2020-04-02scripted-diff: Wallet: Rename mapAddressBook to m_address_bookLuke Dashjr
Previous versions assumed absence of an entry in mapAddressBook indicated change. This no longer holds true (due to bugs) and will shortly be made intentional. Renaming the field helps ensure that old code using mapAddressBook directly gets checked for necessary rebasing. -BEGIN VERIFY SCRIPT- sed -i -e 's/mapAddressBook/m_address_book/g' $(git grep -l 'mapAddressBook' ./src) -END VERIFY SCRIPT-
2020-04-02rpc: Make rpc documentation not depend on rpc argsMarcoFalke
2020-03-28rpc: remove unused getbalances() codeJon Atack
2020-03-26Merge #18312: wallet: remove deprecated fee bumping by totalFeeWladimir J. van der Laan
c3857c5fcb21836ddc1b79a6b19cffe562cade10 wallet: remove CreateTotalBumpTransaction() (Jon Atack) 4a0b27bb01738e6917e27b2cf47f9a8536249693 wallet: remove totalfee from createBumpTransaction() (Jon Atack) e347cfa9a7244277f9d220a4dc3537182f18441e rpc: remove deprecated totalFee arg from RPC bumpfee (Jon Atack) bd05f96d79df1a1561f84850d777808f8575fb8b test: delete wallet_bumpfee_totalfee_deprecation.py (Jon Atack) a6d1ab8caa63bd343207baa60edb705209f16fb4 test: update bumpfee testing from totalFee to fee_rate (Jon Atack) Pull request description: Since 0.19, fee-bumping using `totalFee` was deprecated in #15996 and replaced by `fee_rate` in #16727. This changeset removes it. ACKs for top commit: laanwj: ACK c3857c5fcb21836ddc1b79a6b19cffe562cade10 Tree-SHA512: c1bb15d664baf4d2dea06981f36384af02057d125c51fcbc8640b9d5563532187c7b84aa952f7b575255a88ce383ed4d7495bec920a47b05b6fc0d432dce1f00
2020-03-26rpc: remove deprecated totalFee arg from RPC bumpfeeJon Atack
2020-03-16Merge #18346: rpc: Document an RPCResult for all calls; Enforce at compile timeWladimir J. van der Laan
fac52253f81a4f0d04b25eb4b6c28d04b85ef10b rpc: Document an RPCResult for all calls; Enforce at compile time (MarcoFalke) fadd99f61032c0b75ad9b198eb5d8e307b0518ee rpc: Add missing newline in RPCResult description (MarcoFalke) Pull request description: This documents the RPC Result (type and description, if applicable) everywhere it was missing. The patch can be reviewed with the `git diff` option `-W`/`--function-context`. Also, code won't compile without having an RPCResult documented. ACKs for top commit: laanwj: Lightly tested ACK fac52253f81a4f0d04b25eb4b6c28d04b85ef10b promag: Tested ACK fac52253f81a4f0d04b25eb4b6c28d04b85ef10b, built and verified listunspent help output. Tree-SHA512: af2c1af1432beb944993776026c320814bfaecaf202f47359f5758849096ca7051ec6560395a2cc6678dcc111e7c9cf4917d0f0b221bdcf3ed1642e14d0e5b3c
2020-03-14Replace remaining literals BTC with CURRENCY_UNITDaniel Kraft
This replaces one remaining instance of the literal "BTC" string with the CURRENCY_UNIT constant, as is done in most of the codebase already. The other remaining instance (which is just part of a log message and thus not really user-visible) is just removed. After this change, no instance of literal "BTC" remains anywhere in the non-Qt and non-test codebase.
2020-03-13rpc: Document an RPCResult for all calls; Enforce at compile timeMarcoFalke
2020-03-13rpc: Add missing newline in RPCResult descriptionMarcoFalke
2020-03-11Merge #18268: rpc: Remove redundant types from descriptionsMarcoFalke
8a2a652e6fab5eb8224beefcc07d9011b61865a8 Remove redundant type information from rpc docs (David O'Callaghan) Pull request description: Simple edit of the RPC calls to remove redundant text ("A json object/array ...") from the beginning of help. Fixes: #18258 Top commit has no ACKs. Tree-SHA512: cbbf760e0b7b4eda61c40b420ed77f5d878318e37b0eb13e63567212240b2c4ecc15d84030e98075e21c9ae9016539adfd201e5661ea824166a76d335180c32f
2020-03-11Merge #18208: rpc: Change RPCExamples to bech32MarcoFalke
3e32499909ca8127baaa9b40ad113b25ee151bbd Change example addresses to bech32 (Yusuf Sahin HAMZA) Pull request description: This is a follow-up PR to #18197 that fixes RPCExamples. Fixes #18185. ACKs for top commit: MarcoFalke: ACK 3e32499909ca8127baaa9b40ad113b25ee151bbd jonatack: ACK 3e32499 Tree-SHA512: c7a6410ef8b6e169016c2c5eac3e6b9501caabd0e8a0871ec31e56bfc44589f056d3f5cb55b5a13bba36f6c15136c2352f883e30e4dcc0997ffd36b27f9173b9
2020-03-10Merge #18115: wallet: Pass in transactions and messages for signing instead ↵Samuel Dobson
of exporting the private keys d2774c09cfcc6c5c967d40bb094eabc8c0bdb6bf Clear any input_errors for an input after it is signed (Andrew Chow) dc174881ad8498a6905ba282a48077bc5c8037a7 Replace GetSigningProvider with GetSolvingProvider (Andrew Chow) 6a9c429084b40356aa36aa67992da35f61c2f6a2 Move direct calls to MessageSign into new SignMessage functions in CWallet and ScriptPubKeyMan (Andrew Chow) 82a30fade70a2a95c2bbeac4aa06dafda600479d Move key and script filling and signing from CWallet::FillPSBT to ScriptPubKeyMan::FillPSBT (Andrew Chow) 3d70dd99f9f74eef70b19ff6f6f850adc0d5ef8f Move FillPSBT to be a member of CWallet (Andrew Chow) a4af324d15c1ee43c2abd11a304ae18c7ee82eb0 Use CWallet::SignTransaction in CreateTransaction and signrawtransactionwithwallet (Andrew Chow) f37de927442d3f024926a66c436d59e391c8696a Implement CWallet::SignTransaction using ScriptPubKeyMan::SignTransaction (Andrew Chow) d999dd588cab0ff479bc7bee8c9fc33880265ec6 Add SignTransaction function to ScriptPubKeyMan and LegacyScriptPubKeyMan (Andrew Chow) 2c52b59d0a44a86d94fee4e437978d822862c542 Refactor rawtransaction's SignTransaction into generic SignTransaction function (Andrew Chow) Pull request description: Following #17261, the way to sign transactions, PSBTs, and messages was to use `GetSigningProvider()` and get a `SigningProvider` containing the private keys. However this may not be feasible for future `ScriptPubKeyMan`s, such as for hardware wallets. Instead of exporting a `SigningProvider` containing private keys, we need to pass these things into the `ScriptPubKeyMan` (via `CWallet`) so that they can do whatever is needed internally to sign them. This is largely a refactor as the logic of processing transactions, PSBTs, and messages for is moved into `LegacyScriptPubKeyMan` and `CWallet` instead of being handled by the caller (e.g. `signrawtransaction`). To help with this, I've refactored the 3(!) implementations of a `SignTransaction()` function into one generic one. This function will be called by `signrawtransactionwithkey` and `LegacyScriptPubKeyMan::SignTransaction()`. `CWallet::CreateTransaction()` is changed to call `CWallet::SignTransaction()` which in turn, calls `LegacyScriptPubKeyMan::SignTransaction()`. Other `ScriptPubKeyMan`s may implement `SignTransaction()` differently. `FillPSBT()` is moved to be a member function of `CWallet` and the `psbtwallet.cpp/h` files removed. It is further split so that `CWallet` handles filling the UTXOs while the `ScriptPubKeyMan` handles adding keys, derivation paths, scripts, and signatures. In the end `LegacyScriptPubKeyMan::FillPSBT` still calls `SignPSBTInput`, but the `SigningProvider` is internal to `LegacyScriptPubKeyMan`. Other `ScriptPubKeyMan`s may do something different. A new `SignMessage()` function is added to both `CWallet` and `ScriptPubKeyMan`. Instead of having the caller (i.e. `signmessage` or the sign message dialog) get the private key, hash the message, and sign, `ScriptPubKeyMan` will now handle that (`CWallet` passes through to the `ScriptPubKeyMan`s as it does for many functions). This signing code is thus consolidated into `LegacyScriptPubKeyMan::SignMessage()`, though other `ScriptPubKeyMan`s may implement it differently. Additionally, a `SigningError` enum is introduced for the different errors that we expect to see from `SignMessage()`. Lastly, `GetSigningProvider()` is renamed to `GetPublicSigningProvider()`. It will now only provide pubkeys, key origins, and scripts. `LegacySigningProvider` has it's `GetKey` and `HaveKey` functions changed to only return false. Future implementations should return `HidingSigningProvider`s where private keys are hidden. Other things like `dumpprivkey` and `dumpwallet` are not changed because they directly need and access the `LegacyScriptPubKeyMan` so are not relevant to future changes. ACKs for top commit: instagibbs: reACK https://github.com/bitcoin/bitcoin/pull/18115/commits/d2774c09cfcc6c5c967d40bb094eabc8c0bdb6bf Sjors: re-utACK d2774c09cfcc6c5c967d40bb094eabc8c0bdb6bf meshcollider: re-utACK d2774c09cfcc6c5c967d40bb094eabc8c0bdb6bf Tree-SHA512: 89c83e7e7e9315e283fae145a2264648a9d7f7ace8f3281cb3f44f0b013c988d67ba4fa9726e50c643c0ed921bdd269adaec984840d11acf4a681f3e8a582cc1
2020-03-09Replace GetSigningProvider with GetSolvingProviderAndrew Chow
Not all ScriptPubKeyMans will be able to provide private keys, but pubkeys and scripts should be. So only provide public-only SigningProviders, i.e. ones that can help with Solving.
2020-03-09Move direct calls to MessageSign into new SignMessage functions in CWallet ↵Andrew Chow
and ScriptPubKeyMan Instead of getting a SigningProvider and then going to MessageSign, have ScriptPubKeyMan handle the message signing internally.
2020-03-09Move FillPSBT to be a member of CWalletAndrew Chow
2020-03-09Merge #18274: rpc/wallet: initialize nFeeRequired to avoid using garbage ↵fanquake
value on failure a652ba6293ef8d144935dc882b5f0003c987fa22 rpc/wallet: initialize nFeeRequired to avoid using garbage value on failure (Karl-Johan Alm) Pull request description: Initialize the `nFeeRequired` variable to avoid using an uninitialized value for errors happening before it is set to 0. Note: this originally fixed `nFeeRet` in `wallet.cpp`. ACKs for top commit: promag: ACK a652ba6293ef8d144935dc882b5f0003c987fa22. Sjors: utACK a652ba6293ef8d144935dc882b5f0003c987fa22 practicalswift: ACK a652ba6293ef8d144935dc882b5f0003c987fa22 -- patch looks correct meshcollider: utACK a652ba6293ef8d144935dc882b5f0003c987fa22 Tree-SHA512: 0d12f1ffd0851ed5ce6d109d2c87f55e8b1d57da297e684feeabb57229200c4078f029c55ca5aa5712bd18e26dda3ce538443dfe68a7a6d504428068f81fded0
2020-03-09rpc/wallet: initialize nFeeRequired to avoid using garbage value on failureKarl-Johan Alm
2020-03-08Use CWallet::SignTransaction in CreateTransaction and ↵Andrew Chow
signrawtransactionwithwallet Instead of duplicating signing code, just use the function we already have.
2020-03-07Merge #18241: wallet/refactor: refer to CWallet immutably when possiblefanquake
79facb11e92f8b61063f301027dee7c7344eb1be wallet: use constant CWallets in rpcwallet.cpp (Karl-Johan Alm) d9b0ebc1da8758645f6de24a4a557511ef9b5e36 wallet: make ReserveDestination pwallet ivar const (Karl-Johan Alm) 57c569e4d9779e2263848770e0ba7eab3054a1bf wallet: make BackupWallet() const (Karl-Johan Alm) df3a818d2a9fe48e656a8ad2da18fab8a1bfd6e3 wallet: make getters const (Karl-Johan Alm) 227b9dd2d6e1914edfec108af6bec5f12d9f6f39 wallet/spkm: make GetOldestKeyPoolTime() const (Karl-Johan Alm) 22d329ad0ed3ed501bd811720be6a2876d1afe4d wallet: use constant CWallets in rpcdump.cpp (Karl-Johan Alm) 7b3587b29db9eaf11718fc09d48817a45a0a429a wallet/db: make IsDummy() const (Karl-Johan Alm) d366795d180bc52ba750f71f201a6e5e0c40f1b6 wallet/db: make Backup() const (Karl-Johan Alm) 8cd0b86340870d8f359e4ae26880e03ea36818ab wallet: make CanGetAddresses() const (Karl-Johan Alm) 037fa770eb1ed5152b3ef2c5d3fb2a812d3ef944 wallet: make KeypoolCountExternalKeys() const (Karl-Johan Alm) ddc93557ad0cf8e433df850d38710828ccd99c16 wallet: make CanGenerateKeys() const (Karl-Johan Alm) dc2d0650fdb69d27fe1b0092555b7841d542a635 make BlockUntilSyncedToCurrentChain() const (Karl-Johan Alm) Pull request description: A lot of places refer to `CWallet*`'s as `CWallet * const`, which translates to *"an immutable pointer to a mutable `CWallet` instance"*; this is 1. often not what the author meant, especially as a lot of these places do not at all modify the wallet object, and 2. confusing, as it tends to suggest that this is a proper way to refer to a constant `CWallet` instance. This PR changes references to wallets to `const CWallet* const` whenever immutability is expected. This should result in no behavioral changes at all, and improved compile-time error checking. Note from irc: > <sipa> sounds good to me; this is the sort of change that as long as it compiles, the behavior shouldn't change > <sipa> though in general it may lead to introducing automatic copying of objects sometimes (e.g. trying to std::move a const object will work, but generally result in a copy rather than an efficient move) > <sipa> CWallet objects aren't copied or moved though ACKs for top commit: laanwj: ACK 79facb11e92f8b61063f301027dee7c7344eb1be Empact: ACK https://github.com/bitcoin/bitcoin/pull/18241/commits/79facb11e92f8b61063f301027dee7c7344eb1be promag: ACK 79facb11e92f8b61063f301027dee7c7344eb1be. fjahr: ACK 79facb11e92f8b61063f301027dee7c7344eb1be Tree-SHA512: 80a80c1a52f0f788d0ccb268b53bc0f46c796643a3c5a22b55bbbde4ffa6c7e347784e5e53b1e488a3b4e14399e31d5be9417ad5b6319c74a462609e9b1a98e8
2020-03-05Remove redundant type information from rpc docsDavid O'Callaghan
Co-Authored-By: MarcoFalke <falke.marco@gmail.com>
2020-03-02wallet: use constant CWallets in rpcwallet.cppKarl-Johan Alm
* GetAvoidReuseFlag: simply gets the flag, without modifying the wallet * ListReceived: helper function to produce lists * ListTransactions: produces a list of transactions, without modifications; two cases of map [] -> .at() for verified-existing keys * DescribeWalletAddress: generates a description of a given wallet address without changing the wallet * The following functions produce a list without making any modifications to the wallet: * listaddressgroupings * listreceivedbyaddress * listreceivedbylabel * listtransactions * listsinceblock * listlockunspent * listunspent * listlabels * getreceivedbyaddress * getreceivedbylabel * getaddressesbylabel * signmessage: uses the wallet to procure a private key for signing, but does no modifications * getbalance, getunconfirmedbalance: calculates the wallet balance, without any modifications * gettransaction: procures transaction without any modifications * backupwallet: makes a backup of the wallet to disk, without changing said wallet * getwalletinfo: produces info about wallet without any modifications * signrawtransactionwithwallet: modifies incoming transaction on the fly by signing with private key procured from within wallet; no modifications to wallet * getaddressinfo: gets information about the given address, with no modifications done to the wallet; one case of [] -> .at() and one ::iterator -> ::const_iterator * walletprocesspsbt: processes the given PSBT on the fly, without modifying the wallet
2020-03-01Change example addresses to bech32Yusuf Sahin HAMZA
2020-02-25rpc: Auto-format RPCResultMarcoFalke
2020-02-25Merge #17264: rpc: set default bip32derivs to true for psbt methodsSamuel Dobson
5bad7921d0b33b62c0a59a478c2e8c869fc5e3b5 [test] PSBT RPC: check that bip32_derivs are present by default (Sjors Provoost) 29a21c90610aed88b796a7a5900e42e9048b990e [rpc] set default bip32derivs to true for psbt methods (Sjors Provoost) Pull request description: In https://github.com/bitcoin/bitcoin/pull/13557#pullrequestreview-135905054 I recommended not including bip32 deriviation by default in PSBTs: > _Bit of a privacy issue_: let's say person A and B are about to spend from a multisig address, sending everything to person A. Person A gives their address to person B, their wallet wallet creates a PSBT, but doesn't sign it. Wallet A then calls `walletprocesspsbt` which signs it and _spontaneously adds the master_fingerprint and bip32 path_. Same issue with `walletcreatefundedpsbt`. > > Adding `bip32_derivs` should probably be opt-in. In practice I find this default quite annoying because I forget it and end up with a confused hardware wallet. More importantly, in the multisig example I provided, it's actually essential for the other side to know the derivation details (in addition to an xpub). This allows them to check that change is going to an address you can still co-sign for (because the spending policy is unchanged except for an index). ACKs for top commit: instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/17264/commits/5bad7921d0b33b62c0a59a478c2e8c869fc5e3b5 jonatack: ACK 5bad7921d0 code review, built, ran tests, inspected/messed around with/pprinted values from the new tests. Thanks for adding the tests. meshcollider: utACK 5bad7921d0b33b62c0a59a478c2e8c869fc5e3b5 Tree-SHA512: 22ad71dda96856060a96758c4ae7aafa22d5e9efba30e0c8287c711e7579849bd72593cbc0f41a2e9e8821315d78bda04e848dbb006283b841b2795e2faebcfd
2020-02-25Merge #17577: refactor: deduplicate the message sign/verify codeSamuel Dobson
e193a84fb28068e38d5f54fbfd6208428c5bb655 Refactor message hashing into a utility function (Jeffrey Czyz) f8f0d9893d7969bdaa870fadb94ec5d0dfa8334d Deduplicate the message signing code (Vasil Dimov) 2ce3447eb1e25ec7aec4b300dabf6c1e394f1906 Deduplicate the message verifying code (Vasil Dimov) Pull request description: The message signing and verifying logic was replicated in a few places in the code. Consolidate in a newly introduced `MessageSign()` and `MessageVerify()` and add unit tests for them. ACKs for top commit: Sjors: re-ACK e193a84fb28068e38d5f54fbfd6208428c5bb655 achow101: ACK e193a84fb28068e38d5f54fbfd6208428c5bb655 instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/17577/commits/e193a84fb28068e38d5f54fbfd6208428c5bb655 meshcollider: utACK e193a84fb28068e38d5f54fbfd6208428c5bb655 Tree-SHA512: b0e02a7d4623a98c8f8c77627af1725e6df07700de4630c2f75da6beacdf55414c38ba147bc6d2a757491ab07c827dddf93e8632fe600478760e255714ddab88
2020-02-21scripted-diff: Wallet: Rename incorrectly named *UsedDestinationLuke Dashjr
These functions are used to mark/check if a key of our own has been used to spend (and only for avoid-reuse wallets), which has nothing to do with the destination/address itself. Give them more accurate names to avoid confusion. -BEGIN VERIFY SCRIPT- sed -i -e 's/UsedDestination/SpentKey/g' $(git grep -l 'UsedDestination' ./src) -END VERIFY SCRIPT-
2020-02-20Merge #18122: rpc: update validateaddress RPCExamples to bech32fanquake
7f1475c7119e8c72bce39a63386a6ca859066b80 rpc: update validateaddress RPCExamples to bech32 (Sebastian Falbesoner) Pull request description: Another small step to get rid of legacy addresses in the RPC help texts and by that encourage the use of bech32 addresses by default. The (invalid) address is the same as in the `getaddressinfo` RPC (see 2ee0cb3330ccf70f0540cb42370796e32eff1569, kudos to jonatack!), I don't think it adds any value to have a different example address per RPC. ACKs for top commit: fanquake: ACK 7f1475c7119e8c72bce39a63386a6ca859066b80 MarcoFalke: ACK 7f1475c7119e8c72bce39a63386a6ca859066b80 Tree-SHA512: 2350f61fa942a9053f9f5c860ea446965dc7209c71c81bdb98a859d03ca23b225ad72c9c506e4a55c8d8988823d9cfbe808c1a452a1eeadb70ab186b146dd4ca
2020-02-16Merge #18098: scripted-diff: Add missing spaces in RPCResult, Normalize type ↵MarcoFalke
names fad027fb0ce019f31b20861c37e802d4e29e6931 scripted-diff: Add missing spaces in RPCResult, Fix type names (MarcoFalke) Pull request description: This makes the rendered diff smaller when the RPCResult is machine generated later on (Previous attempts: #14601 and #14459) ACKs for top commit: Sjors: ACK fad027fb0ce019f31b20861c37e802d4e29e6931 Tree-SHA512: 48afd571b1cd349ca0b29bb444c1c7cda657e07dd96c610d479f931ccd938186aec98e533d0552b5b10afc9a3d7b911359260a49448e8e1106e3647b2c71f3ba
2020-02-14Deduplicate the message signing codeVasil Dimov
The logic of signing a message was duplicated in 3 places: src/qt/signverifymessagedialog.cpp SignVerifyMessageDialog::on_signMessageButton_SM_clicked() src/rpc/misc.cpp signmessagewithprivkey() src/wallet/rpcwallet.cpp signmessage() Move the logic into src/util/message.cpp MessageSign() and call it from all the 3 places.
2020-02-14Deduplicate the message verifying codeVasil Dimov
The logic of verifying a message was duplicated in 2 places: src/qt/signverifymessagedialog.cpp SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked() src/rpc/misc.cpp verifymessage() with the only difference being the result handling. Move the logic into a dedicated src/util/message.cpp MessageVerify() which returns a set of result codes, call it from the 2 places and just handle the results differently in the callers.
2020-02-13Merge #17746: refactor: rpc: Remove vector copy from listtransactionsWladimir J. van der Laan
25bc17fceb08ee9625c5e09e2579117ec6f7a1c5 refactor: rpc: Remove vector copy from listtransactions (João Barbosa) Pull request description: Current approach - copy accumulated `ret` vector to `arrTmp` - drop unnecessary elements from `arrTmp` - reverse `arrTmp` - clear `ret` - copy `arrTmp` to the `ret` New approach - create a vector from the accumulated `ret` with just the necessary elements already reversed - copy it to the result This PR doesn't change behavior. ACKs for top commit: ryanofsky: Code review ACK 25bc17fceb08ee9625c5e09e2579117ec6f7a1c5. Just comment and commit message tweaks since last review Tree-SHA512: 87906561e3accdbdb0f4a8194cbcd76ea53ae53d0ce135b90bc54a5f77e300b14ef08505e7daf1fe52426f135442a743da5a027416a769bd454922357cebe7c0
2020-02-13refactor: rpc: Remove vector copy from listtransactionsJoão Barbosa
No change in behavior.
2020-02-13rpc: update validateaddress RPCExamples to bech32Sebastian Falbesoner
also contains the following changes: - rpc: factor out example bech32 address for RPCExamples - doc: update developer notes wrt RPCExamples addresses (mention the EXAMPLE_ADDRESS constant as an example for an invalid bech32 address suitable for RPCExamples help documentation)
2020-02-09scripted-diff: Add missing spaces in RPCResult, Fix type namesMarcoFalke
This makes the rendered diff smaller when the RPCResult is machine generated later on -BEGIN VERIFY SCRIPT- # Add space after dictionary key and before colon sed -i --regexp-extended -e 's/(^ +" +\\"[a-zA-Z_]+\\"): ?/\1 : /g' $(git grep -l '\\":') # Rename (array) to (json array) sed -i -e 's/ (array) / (json array) /g' $(git grep -l '(array)' ./src) # Rename (object) to (json object) sed -i -e 's/ (object) / (json object) /g' $(git grep -l '(object)' ./src) # Rename (bool) to (boolean) sed -i -e 's/ (bool) / (boolean) /g' $(git grep -l '(bool)' ./src) # Rename (int) to (numeric) sed -i -e 's/ (int) / (numeric) /g' $(git grep -l '(int)' ./src) -END VERIFY SCRIPT-
2020-02-09Merge #18032: rpc: Output a descriptor in createmultisig and addmultisigaddressMarcoFalke
19a354b11f85a3c6c81ff83bf702bf7a40cf5046 Output a descriptor in createmultisig and addmultisigaddress (Andrew Chow) Pull request description: Give a descriptor from `createmultisig` and `addmultisigaddress`. Extracted from #16528 with `addmultisgaddress` and tests added. ACKs for top commit: Sjors: tACK 19a354b11f85a3c6c81ff83bf702bf7a40cf5046 MarcoFalke: ACK 19a354b11f85a3c6c81ff83bf702bf7a40cf5046 promag: Code review ACK 19a354b11f85a3c6c81ff83bf702bf7a40cf5046. meshcollider: utACK 19a354b11f85a3c6c81ff83bf702bf7a40cf5046 Tree-SHA512: e813125fbbc358ea8d45b1748de16a29a94efd83175b748fb8fa3b0bfc8e783ed36b6c554d84f5d4ead1ba252a83a3e937b6c3f75da7b8d3b4e55f94d6013771
2020-02-05Merge #17804: doc: Misc RPC help fixesWladimir J. van der Laan
fa5c6622c8ecf1954e7177888ad8c97a77b16fb7 doc: Use proper RPC help syntax in importmulti (MarcoFalke) fab63111bec73859597e6ce0986f76e5e9959091 doc: Remove duplicate "comment" from listsinceblock RPC help (MarcoFalke) fa04cd6cfc0330b62058ed169d621e08108dc87e doc: Properly document proxy_randomize_credentials as bool in getnetworkinfo (MarcoFalke) fa9dec7c395897e8dbbb6de7a16ec5185a609d41 doc: Fix syntax error (trailing square bracket) in finalizepsbt (MarcoFalke) faff5a60ed328d4c5fdef253e8935a351cb57bd0 doc: Fix syntax error (trailing square bracket) in walletprocesspsbt (MarcoFalke) fa0545901daad32b09511cc61c4af1400c48088d doc: Add missing "optional" to "long" estimaterawfee RPC help (MarcoFalke) Pull request description: This fixes documentation of the following RPCs: * estimaterawfee (hidden) * https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/walletprocesspsbt/ * https://bitcoincore.org/en/doc/0.19.0/rpc/rawtransactions/finalizepsbt/ * https://bitcoincore.org/en/doc/0.19.0/rpc/network/getnetworkinfo/ * https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/listsinceblock/ * https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/importmulti/ <!-- Also, it comes with a scripted diff to normalize whitespace and type names. (Previous attempts: #14601 and #14459) ACKs for top commit: laanwj: ACK fa5c6622c8ecf1954e7177888ad8c97a77b16fb7 Tree-SHA512: 5a10956e12f8ce23e93a2ce8bafd6cae759d8a21658f79397e3bfce3e4aabd9658bdbd40acde49323dca958a9befee7166654994208c182dd60f483109621e17
2020-02-02Merge #17585: rpc: deprecate getaddressinfo labelSamuel Dobson
d3bc18408146e91b3836f72360ff6fa2420b6887 doc: update release notes with getaddressinfo label deprecation (Jon Atack) 72af93f36479dc12d795f1d05fa3d8fbd9b293bd test: getaddressinfo label deprecation test (Jon Atack) d48875fa20d0b71b978cb3d1f85dd9ec14e664cc rpc: deprecate getaddressinfo label field (Jon Atack) dc0cabeda49a7edbfa71df22846721b6f6224aea test: remove getaddressinfo label tests (Jon Atack) c7654af6f830577a54df12b5d65df93532db0dc2 doc: address pr17578 review feedback (Jon Atack) Pull request description: This PR builds on #17578 (now merged) and deprecates the rpc getaddressinfo `label` field. The deprecated behavior can be re-enabled by starting bitcoind with `-deprecatedrpc=label`. See http://www.erisian.com.au/bitcoin-core-dev/log-2019-11-22.html#l-622 and https://github.com/bitcoin/bitcoin/pull/17283#issuecomment-554458001 for more context. Reviewers: This PR may be tested manually by building, then running bitcoind with and without the `-deprecatedrpc=label` flag while verifying the rpc getaddressinfo output and help text. Next step: add support for multiple labels. ACKs for top commit: jnewbery: ACK d3bc18408146e91b3836f72360ff6fa2420b6887 laanwj: ACK d3bc18408146e91b3836f72360ff6fa2420b6887 meshcollider: utACK d3bc18408146e91b3836f72360ff6fa2420b6887 Tree-SHA512: f954402884ec54977def332c8160fd892f289b0d2aee1e91fed9ac3220f7e5b1f7fc6421b84cc7a5c824a0582eca4e6fc194e4e33ddd378c733c8941ac45f56d
2020-01-30Output a descriptor in createmultisig and addmultisigaddressAndrew Chow
2020-01-23Refactor: Replace SigningProvider pointers with unique_ptrsAndrew Chow
Needed for future ScriptPubKeyMans which may need to create SigningProviders dynamically and thus a normal pointer is not enough This commit does not change behavior.
2020-01-23Refactor: Allow LegacyScriptPubKeyMan to be nullAndrew Chow
In CWallet::LoadWallet, use this to detect and empty wallet with no keys This commit does not change behavior.
2020-01-23Locking: Lock cs_KeyStore instead of cs_wallet in legacy keymanAndrew Chow
This commit only affects locking behavior and doesn't have other changes.
2020-01-23doc: Remove duplicate "comment" from listsinceblock RPC helpMarcoFalke
Also, properly document all (json object) and (json array)