aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
AgeCommit message (Collapse)Author
2020-11-17Merge #20305: wallet: introduce fee_rate sat/vB param/optionMarcoFalke
05e82d86b09d914ebce05dbc92a7299cb026847b wallet: override minfee checks (fOverrideFeeRate) for fee_rate (Jon Atack) 9a670b4f07a6140de809d73cbd7f3e614eb6ea74 wallet: update sendtoaddress, send RPC examples with fee_rate (Jon Atack) be481b72e24fb6834bd674cd8daee67c6938b42d wallet: use MIN_RELAY_TX_FEE in bumpfee help (Jon Atack) 449b730579566459e350703611629e63e54657ed wallet: provide valid values if invalid estimate mode passed (Jon Atack) 6da3afbaee5809ebf6d88efaa3958c505c2d71c7 wallet: update remaining rpcwallet fee rate units to BTC/kvB (Jon Atack) 173b5b5fe07d45be5a1e5bc7a5df996f20ab1e85 wallet: update fee rate units, use sat/vB for fee_rate error messages (Jon Atack) 7f9835a05abf3e168ad93e7195cbaa4bf61b9b07 wallet: remove fee rates from conf_target helps (Jon Atack) b7994c01e9a3251536fe6538a22f614774eec82d wallet: add fee_rate unit warnings to bumpfee (Jon Atack) 410e471fa42d3db04e8879c71f8c824dcc151a83 wallet: remove redundant bumpfee fee_rate checks (Jon Atack) a0d495747320c79b27a83c216dcc526ac8df8f24 wallet: introduce fee_rate (sat/vB) param/option (Jon Atack) e21212f01b7c41eba13b0479b252053cf482bc1f wallet: remove unneeded WALLET_BTC_KB_TO_SAT_B constant (Jon Atack) 6112cf20d43b0be34fe0edce2ac3e6b27cae1bbe wallet: add CFeeRate ctor doxygen documentation (Jon Atack) 3f7279161347543ce4e997d78ea89a4043491145 wallet: fix bug in RPC send options (Jon Atack) Pull request description: This PR builds on #11413 and #20220 to address #19543. - replace overloading the conf_target and estimate_mode params with `fee_rate` in sat/vB in the sendtoaddress, sendmany, send, fundrawtransaction, walletcreatefundedpsbt, and bumpfee RPCs - allow non-actionable conf_target value of `0` and estimate_mode value of `""` to be passed to use `fee_rate` as a positional argument, in addition to as a named argument - fix a bug in the experimental send RPC described in https://github.com/bitcoin/bitcoin/pull/20220#discussion_r513789526 where args were not being passed correctly into the options values - update the feerate error message units for these RPCs from BTC/kB to sat/vB - update the test coverage, help docs, doxygen docs, and some of the RPC examples - other changes to address the excellent review feedback See this wallet meeting log for more context: http://www.erisian.com.au/bitcoin-core-dev/log-2020-11-06.html#l-309 ACKs for top commit: achow101: re-ACK 05e82d8 MarcoFalke: review ACK 05e82d86b0 did not test and found a few style nits, which can be fixed later šŸÆ Xekyo: tACK 05e82d86b09d914ebce05dbc92a7299cb026847b Sjors: utACK 05e82d86b09d914ebce05dbc92a7299cb026847b Tree-SHA512: a4ee5f184ada53f1840b2923d25873bda88c5a2ae48e67eeea2417a0b35154798cfdb3c147b05dd56bd6608a784e1b91623bb985ee2ab9ef2baaec22206d0a9c
2020-11-17Merge #20139: Wallet: do not return warnings from UpgradeWallet()MarcoFalke
963696288955dc31b3a4fd136bfb791a9d99755b [upgradewallet] removed unused warning param (Sishir Giri) Pull request description: The `warning` variable was unused in `upgradewallet` so I removed it ACKs for top commit: practicalswift: ACK 963696288955dc31b3a4fd136bfb791a9d99755b: diff looks correct MarcoFalke: review ACK 963696288955dc31b3a4fd136bfb791a9d99755b jonatack: ACK 963696288955dc31b3a4fd136bfb791a9d99755b Tree-SHA512: 1d63186ce1e05e86a778340f2d7986c2cee1523de0a11cea39e8d148ac7ee26c49741dfa302b5c1cd1c8d74e67c1f9baee2763720c2d850b57da9a3fdce24565
2020-11-16[upgradewallet] removed unused warning paramSishir Giri
2020-11-14Add missing optional.h includeKristaps Kaupe
2020-11-14Silence false positive GCC warningKristaps Kaupe
2020-11-12wallet: override minfee checks (fOverrideFeeRate) for fee_rateJon Atack
in RPCs fundrawtransaction and walletcreatefundedpsbt only. This provides the existing feeRate (BTC/kvB) behavior in these two RPCs to the new fee_rate (sat/vB) param also. See these two GitHub review discussions for more info: https://github.com/bitcoin/bitcoin/pull/10706/#discussion_r126560525 https://github.com/bitcoin/bitcoin/pull/20305#discussion_r520032533
2020-11-12wallet: update sendtoaddress, send RPC examples with fee_rateJon Atack
2020-11-12wallet: use MIN_RELAY_TX_FEE in bumpfee helpJon Atack
Co-authored-by: Murch <murch@murch.one>
2020-11-12wallet: provide valid values if invalid estimate mode passedJon Atack
Co-authored-by: Murch <murch@murch.one>
2020-11-12wallet: update remaining rpcwallet fee rate units to BTC/kvBJon Atack
2020-11-12wallet: update fee rate units, use sat/vB for fee_rate error messagesJon Atack
and BTC/kvB for feeRate error messages.
2020-11-11wallet: remove fee rates from conf_target helpsJon Atack
2020-11-11wallet: add fee_rate unit warnings to bumpfeeJon Atack
2020-11-11wallet: remove redundant bumpfee fee_rate checksJon Atack
SetFeeEstimateMode() handles these checks now and provides a more actionable error message.
2020-11-11wallet: introduce fee_rate (sat/vB) param/optionJon Atack
Create a fee_rate (sat/vB) RPC param and replace overloading the conf_target and estimate_mode params in the following 6 RPCs with it: - sendtoaddress - sendmany - send - fundrawtransaction - walletcreatefundedpsbt - bumpfee In RPC bumpfee, the previously existing fee_rate remains but the unit is changed from BTC/kvB to sat/vB. This is a breaking change, but it should not be an overly risky one, as the units change by a factor of 1e5 and any fees specified in BTC/kvB after this commit will either be too low and raise an error or be 1 sat/vB and can be RBFed. Update the test coverage for each RPC. Co-authored-by: Murch <murch@murch.one>
2020-11-11wallet: remove unneeded WALLET_BTC_KB_TO_SAT_B constantJon Atack
2020-11-11wallet: fix bug in RPC send optionsJon Atack
when empty, options were not being populated by arguments of the same name found while adding test coverage in 603c0050
2020-11-04Merge #20220: wallet, rpc: explicit fee rate follow-ups/fixes for 0.21Samuel Dobson
0be29000c011dec0722481dbebb159873da6fa54 rpc: update conf_target helps for correctness/consistency (Jon Atack) 778b9be40667876c705e586849ea9c9e44cf451c wallet, rpc: fix send subtract_fee_from_outputs help (Jon Atack) 603c0050837ec65765208dd54dde354145fbe098 wallet: add rpc send explicit fee rate coverage (Jon Atack) dd341e602d5160fc621c0299179b91403756b61d wallet: add sendtoaddress/sendmany explicit fee rate coverage (Jon Atack) 44e7bfa60313e4ae67da49e5ba4535038b71b453 wallet: add walletcreatefundedpsbt explicit fee rate coverage (Jon Atack) 6e1ea4273e52fdcd86c87628aa595c03a071ca8c test: refactor for walletcreatefundedpsbt fee rate coverage (Jon Atack) 3ac7b0c6f1c68e74a84d868a454f508bada6b09d wallet: fundrawtx fee rate coverage, fixup ParseConfirmTarget() (Jon Atack) 2d8eba8f8425a2515022d51f1f5b4911329fbf55 wallet: combine redundant bumpfee invalid params and args tests (Jon Atack) 1697a40b6f841a54ee0d9744ed7fd09034b0ddad wallet: improve bumpfee error/help, add explicit fee rate coverage (Jon Atack) fc5721723d34f76f9e1ffd2e31f274ea6b22f894 wallet: fix SetFeeEstimateMode() error message (Jon Atack) 052427eef1c9da84c474c5161b1910d3328ef0da wallet, bugfix: fix bumpfee with explicit fee rate modes (Jon Atack) Pull request description: Follow-up to #11413 providing a base to build on for #19543: - bugfix for `bumpfee` raising a JSON error with explicit feerates, fixes issue #20219 - adds explicit feerate test coverage for `bumpfee`, `fundrawtransaction`, `walletcreatefundedpsbt`, `send`, `sendtoaddress`, and `sendmany` - improves a few related RPC error messages and `ParseConfirmTarget()` / error message - fixes/improves the explicit fee rate information in the 6 RPC helps, of which 2 were also missing `conf_target` sat/B units This provides a spec and regression coverage for the potential next step of a universal `sat/vB` feerate argument (see #19543), as well as immediate coverage and minimum fixes for 0.21. ACKs for top commit: kallewoof: Concept/Tested ACK 0be29000c011dec0722481dbebb159873da6fa54 meshcollider: Code review + functional test run ACK 0be29000c011dec0722481dbebb159873da6fa54 Tree-SHA512: efd965003e991cba51d4504e2940f06ab3d742e34022e96a673606b44fad85596aa03a8c1809f06df7ebcf21a38e18a891e54392fe3d6fb4d120bbe4ea0cf5e0
2020-11-02[wallet] Return object from upgradewallet RPCSishir Giri
2020-10-29Merge #20156: build: Make sqlite support optional (compile-time)Wladimir J. van der Laan
bbb42a68961a8ae1e4ef3221ffb1d5ff7272b075 RPC: createwallet: Nicer error message if descriptor wallet requested and sqlite support not compiled in (Luke Dashjr) 6608fec332eac4dfd91138bc4fe2e1b5c7bb758f GUI: Create Wallet: Nicely disable descriptor wallet checkbox if sqlite support not compiled in (Luke Dashjr) 7b54d768e1514b328e1ac108d3db2f1bac3ba7ff Make sqlite support optional (compile-time) (Luke Dashjr) Pull request description: As a new requirement, sqlite support should be optional. This PR aims to be only minimum/blocker changes for 0.21. Potential follow-up PRs after this: * Make BDB support optional * Nicer error messages when user tries to load an unsupported wallet * Don't compile descriptor wallet code if sqlite disabled ACKs for top commit: jonasschnelli: Tested ACK bbb42a68961a8ae1e4ef3221ffb1d5ff7272b075 achow101: ACK bbb42a68961a8ae1e4ef3221ffb1d5ff7272b075 Sjors: re-utACK bbb42a68961a8ae1e4ef3221ffb1d5ff7272b075 hebasto: ACK bbb42a68961a8ae1e4ef3221ffb1d5ff7272b075, tested on Linux Mint 20 (x86_64, Qt 5.12.8). Tree-SHA512: 500209dd1971310fab8ae51543343ce0ba91f088ccccff6109b4cc27547cd5532289dca6cb7dac2a7d7c59cdf3c8f5aacc31e9b0f912e38cea52ec26b97100bd
2020-10-29rpc: update conf_target helps for correctness/consistencyJon Atack
for sendtoaddress, sendmany, send, fundrawtransaction, walletcreatefundedpsbt, bumpfee
2020-10-29wallet, rpc: fix send subtract_fee_from_outputs helpJon Atack
2020-10-27wallet: improve bumpfee error/help, add explicit fee rate coverageJon Atack
2020-10-25wallet: fix SetFeeEstimateMode() error messageJon Atack
to clarify for the user the confusing error message that the missing fee rate needs to be set in the conf_target param/option.
2020-10-24wallet, bugfix: fix bumpfee with explicit fee rate modesJon Atack
2020-10-20RPC: createwallet: Nicer error message if descriptor wallet requested and ā†µLuke Dashjr
sqlite support not compiled in
2020-10-20Merge #20125: rpc, wallet: Expose database format in getwalletinfoSamuel Dobson
624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 test: add coverage for getwalletinfo format field (Jon Atack) 5e737a009234cbd7cf53748d3d28a2da5221192f rpc, wallet: Expose database format in getwalletinfo (JoĆ£o Barbosa) Pull request description: Support for sqlite based wallets was added in #19077. This PR adds the `format` key in `getwalletinfo` response, that can be `bdb` or `sqlite`. ACKs for top commit: jonatack: Tested ACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 laanwj: Code review ACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721. MarcoFalke: doesn't hurt ACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 hebasto: ACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721, tested on Linux Mint 20 (x86_64). meshcollider: utACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 Tree-SHA512: a81f8530f040f6381d33e073a65f281993eccfa717424ab6e651c1203cbaf27794dcb7175570459e7fdaa211565bc060d0a3ecbe70d2b6f9c49b8d5071e4441c
2020-10-16Merge #19836: rpc: Properly deserialize txs with witness before signingfanquake
33330778230961cfbf2a24de36b5877e395cc596 rpc: Adjust witness-tx deserialize error message (MarcoFalke) cccc7525697e7b8d99b545e34f0f504c78ffdb94 rpc: Properly deserialize txs with witness before signing (MarcoFalke) Pull request description: Signing a transaction can only happen when the transaction has inputs. A transaction with inputs can always be deserialized as witness-transaction. If `try_no_witness` decoding is attempted, this will lead to rare intermittent failures. Fixes #18803 ACKs for top commit: achow101: ACK 33330778230961cfbf2a24de36b5877e395cc596 ajtowns: ACK 33330778230961cfbf2a24de36b5877e395cc596 Tree-SHA512: 73f8a5cdfe03fb0e68908d2fa09752c346406f455694a020ec0dd1267ef8f0a583b8e84063ea74aac127106dd193b72623ca6d81469a94b3f5b3c766ebf2c42b
2020-10-14rpc, wallet: Expose database format in getwalletinfoJoĆ£o Barbosa
2020-10-13rpc: Adjust witness-tx deserialize error messageMarcoFalke
2020-10-07rpc: change no wallet loaded message to be clearerAndrew Chow
Changes the no wallet is loaded rpc error message to be clearer that no wallet is loaded and how the user can load or create a wallet. Also changes the error code from METHOD_NOT_FOUND to RPC_WALLET_NOT_FOUND as that makes more sense.
2020-10-03Merge #19956: rpc: Improve invalid vout value rpc error messagefanquake
f471a3be00c2b6433b8c258b716982c0539da13f scripted diff: Improve invalid vout value rpc error message (Nima Yazdanmehr) Pull request description: Since the `vout` value can start at `0`, the error message for *negative* values can be improved to something like: `vout cannot be negative`. ACKs for top commit: fanquake: ACK f471a3be00c2b6433b8c258b716982c0539da13f promag: Code review ACK f471a3be00c2b6433b8c258b716982c0539da13f. Tree-SHA512: fbdee3d0ddd5b58eb93934a1217b44e125a9ad39e672b1f35c7609c6c5fcf45ae1b731d3d6135b7225d98792dbfc34a50907b8c41274a5b029d7b5c59f886560
2020-09-30scripted diff: Improve invalid vout value rpc error messageNima Yazdanmehr
-BEGIN VERIFY SCRIPT- r() { sed -i 's/vout must be positive/vout cannot be negative/g' $1 } r $(git grep -l 'vout must be positive') -END VERIFY SCRIPT-
2020-09-30doc: Remove double-whitespace from help string, other whitespace fixupsMarcoFalke
2020-09-30Merge #19501: send* RPCs in the wallet returns the "fee reason"MarcoFalke
69cf5d4eeb73f7d685e915fc17af64634d88a4a2 [test] Make sure send rpc returns fee reason (Sishir Giri) d5863c0b3e20d56acf7246008b7832efde68ab21 [send] Make send RPCs return fee reason (Sishir Giri) Pull request description: Whenever a wallet funds a transaction, the fee reason is reported to the user only if the verbose is set to true. I added an extra parameter to `CreateTransaction` function in wallet.cpp. Then I implemented the fee reason return logic in `SendMoney` in rpcwallet.cpp, followed by verbose parameter in `sendtoaddress` and `sendmany` functions. I also added a fee reason test case in walletbasic.py. link to the issue: https://github.com/MarcoFalke/bitcoin-core/issues/22#issue-616251578 ACKs for top commit: instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/19501/commits/69cf5d4eeb73f7d685e915fc17af64634d88a4a2 meshcollider: utACK 69cf5d4eeb73f7d685e915fc17af64634d88a4a2 Tree-SHA512: 2e3af32dcfbd5511ba95f8bc8edca7acfe709a8430ff03e43172e5d0af3dfa4b2f57906978e7f272d878043b9ed8c6004674cf47d7496b005d5f612e9a58aa0e
2020-09-29Merge #19969: Send RPC bug fix and touch-upsfanquake
f7b331ea85d45c7337e527b6e77a45da7a689b7d rpc: add brackets to ConstructTransaction (Sjors Provoost) d813d26f06248aaa7be3c698c87939cc777fafd0 [rpc] send: various touch-ups (Sjors Provoost) 0fc1c685e1ca68ca8ed2b35f623bbe6a9fc36d66 [rpc] send: fix parsing replaceable option (Sjors Provoost) efc9b85e6f4aa431d308089874a18f0bbdcdd0fd Mark send RPC experimental (Sjors Provoost) Pull request description: Followup based on #16378 nits. It also fixes an argument parsing error (uncaught because the test wasn't sufficiently thorough). I marked the RPC as experimental so we can tweak it a bit over the next release cycle. ACKs for top commit: meshcollider: utACK f7b331ea85d45c7337e527b6e77a45da7a689b7d fjahr: utACK f7b331ea85d45c7337e527b6e77a45da7a689b7d kallewoof: ACK f7b331ea85d45c7337e527b6e77a45da7a689b7d Tree-SHA512: 82dd8ac76a6558872db3f5249d4d6440469400aaa339153bc627d1ee673a91ecfadecb486bc1939ba87ebbd80e26ff29698e93e358599f3d26fde0e526892afe
2020-09-26[send] Make send RPCs return fee reasonSishir Giri
2020-09-22Assert that RPCArg names are equal to CRPCCommand ones (net, rpcwallet)MarcoFalke
2020-09-17[rpc] send: various touch-upsSjors Provoost
2020-09-17[rpc] send: fix parsing replaceable optionSjors Provoost
2020-09-17Mark send RPC experimentalSjors Provoost
2020-09-10[rpc] add send methodSjors Provoost
2020-09-07[rpc] add snake case aliases for transaction methodsSjors Provoost
2020-09-07[rpc] walletcreatefundedpsbt: allow inputs to be nullSjors Provoost
This is of neglible use here, but it allows new RPC methods to take outputs as their first argument and make inputs optional.
2020-09-03wallet: Remove path checking code from createwallet RPCRussell Yanofsky
This commit does not change behavior except for error messages which now include more complete information.
2020-09-03wallet: Remove path checking code from loadwallet RPCRussell Yanofsky
This commit does not change behavior except for error messages which now include more complete information.
2020-09-03refactor: Use DatabaseStatus and DatabaseOptions typesRussell Yanofsky
No changes in behavior. Just replaces arguments and return types
2020-09-03Remove WalletLocation classRussell Yanofsky
This removes a source of complexity and indirection that makes it harder to understand path checking code. Path checks will be simplified in upcoming commits. There is no change in behavior in this commit other than a slightly more descriptive error message in `loadwallet` if the default "" wallet can't be found. (The error message is improved more in upcoming commit "wallet: Remove path checking code from loadwallet RPC".)
2020-09-03Merge #19754: wallet, gui: Reload previously loaded wallets on startupJonas Schnelli
f1ee37319a7a211e5fb325406d62db5b61dbd30e wallet: Reload previously loaded wallets on GUI startup (Andrew Chow) Pull request description: Enable the GUI to also use the load_on_startup feature. Wallets loaded in the GUI always have load_on_startup=true. When they are unloaded from the GUI, load_on_startup=false. To facilitate this change, UpdateWalletSetting is moved into the wallet module and called from within LoadWallet, RemoveWallet, and Createwallet. This change does not actually touch the GUI code but rather the wallet functions that are shared between the GUI and RPC. ACKs for top commit: jonasschnelli: Tested ACK f1ee37319a7a211e5fb325406d62db5b61dbd30e - works as expected. Wallets loaded via bitcoin-cli (in `-server` mode) or through the RPC console won't be loaded on startup but wallets loaded via the GUI menu will. kristapsk: ACK f1ee37319a7a211e5fb325406d62db5b61dbd30e, I have tested the code. Tree-SHA512: f5b44aa763cf761d919015c5fbc0600b72434aa71e3b57007fd7530a29c3da1a9a0c98c4f22cb6cdffba61150a31170056a7d4737625e7b76f6958f3d584da8c
2020-09-01wallet: Reload previously loaded wallets on GUI startupAndrew Chow
Enable the GUI to also use the load_on_startup feature. Wallets loaded in the GUI always have load_on_startup=true. When they are unloaded from the GUI, load_on_startup=false. To facilitate this change, UpdateWalletSetting is moved into the wallet module and called from within LoadWallet, RemoveWallet, and Createwallet. This change does not actually touch the GUI code but rather the wallet functions that are shared between the GUI and RPC.