aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
AgeCommit message (Collapse)Author
2019-05-29wallet/rpc: add 'avoid_reuse' option to RPC commandsKarl-Johan Alm
createwallet, getbalance, getwalletinfo, listunspent, sendtoaddress rpc/wallet: listunspent include reused flag and show reused utxos by default
2019-05-29wallet/rpc: add setwalletflag RPC and MUTABLE_WALLET_FLAGSKarl-Johan Alm
2019-05-29wallet: avoid reuse flagsKarl-Johan Alm
Add m_avoid_address_reuse flag to coin control object. Add avoid_reuse wallet flag and accompanying strings/caveats.
2019-05-22rpc: Mention getwalletinfo where a rescan is triggeredJoão Barbosa
2019-05-16rpc: bugfix: Properly use iswitness in converttopsbtMarcoFalke
Also explain the param in all RPCs
2019-05-16rpc: Switch touched RPCs to IsValidNumArgsMarcoFalke
2019-05-13Add option to create an encrypted walletAndrew Chow
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-06Merge #15730: rpc: Show scanning details in getwalletinfoWladimir J. van der Laan
b6c748f84909212dce73e4b77aa125ed1e108a10 doc: Add release notes for 15730 (João Barbosa) d3e8458365ab29017241bc43204fe81cb7fd8530 rpc: Show scanning details in getwalletinfo (João Barbosa) 90e27abe37cc84c7b206f20d28aafe32e71e7209 wallet: Track current scanning progress (João Barbosa) 2ee811e6930cf76ea51e6826fe437ed888688adc wallet: Track scanning duration (João Barbosa) Pull request description: Closes #15724. ACKs for commit b6c748: MarcoFalke: re-utACK b6c748f849 (Only change since my last review is rebase, adding release notes, and returning false instead of null) laanwj: utACK b6c748f84909212dce73e4b77aa125ed1e108a10 jonatack: ACK b6c748f84909212dce73e4b77aa125ed1e108a10, only changes appear to be rebase for https://github.com/bitcoin/bitcoin/pull/15730#discussion_r280030617 and release notes. Tree-SHA512: 8ee98f971c15f66ce8138fc92c55e51abc9faf01866a31ac7ce2ad766aa2bb88559eabee3b5815d645c84cdf1c19dc35ec03f31461e39bc5f6040edec0b87116
2019-05-03rpc: Deprecate getunconfirmedbalance and getwalletinfo balancesMarcoFalke
2019-05-02rpc: Add getbalances RPCMarcoFalke
2019-05-02rpcwallet: Make helper methods const on CWalletMarcoFalke
2019-05-02rpc: Show scanning details in getwalletinfoJoão Barbosa
2019-05-01wallet: Use IsValidNumArgs in getwalletinfo rpcMarcoFalke
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-23Merge #15463: rpc: Speedup getaddressesbylabelMarcoFalke
710a7136f9 rpc: Speedup getaddressesbylabel (João Barbosa) Pull request description: Fixes #15447. Same approach of #14984, this change avoids duplicate key check when building the JSON response in memory. ACKs for commit 710a71: MarcoFalke: utACK 710a7136f93133bf256d37dc8c8faf5a6b9ba89d ryanofsky: utACK 710a7136f93133bf256d37dc8c8faf5a6b9ba89d. Just new comments and assert since last review. Tree-SHA512: 77c95df9ff3793e348619aa070e6fd36df9da1b461d708ab146652cb3699f1a472ef6eb38dafdb8374375cbc97daef07635fcb0501961f167a023309513742e2
2019-04-22rpc: Speedup getaddressesbylabelJoão Barbosa
2019-04-17rpc: Remove dependency on interfaces::Chain in SignTransactionAntoine Riard
Comment SignTransaction utility
2019-04-15Merge #15750: [rpc] Remove the addresses field from the getaddressinfo ↵MarcoFalke
return object b4338c151d [rpc] Remove the addresses field from the getaddressinfo return object (John Newbery) Pull request description: The "addresses" field was confusing because it refered to public keys using their P2PKH address. It was included in the return object when needed for backward compatibility. Remove that compatibility now that the -deprecatedrpc=validateaddress option has been removed. New applications should use the 'embedded'->'address' field for P2SH or P2WSH wrapped addresses, and 'pubkeys' for inspecting multisig participants. ACKs for commit b4338c: jonatack: ACK https://github.com/bitcoin/bitcoin/pull/15750/commits/b4338c151d4788c33f4b7c54daaf7f94b193a624. Tests [gist](https://gist.github.com/jonatack/31915e290bb1be39b9769dc9357385ca). Tree-SHA512: 2c207510e565df600428838bfc6db5211fa06aaace365e31cbd74f1d2376b598675cb90df2fc1440858d49b22095aaa9d6b9ce3de0aff22417fe72cc6a6a321f
2019-04-11[rpc] Remove the addresses field from the getaddressinfo return objectJohn Newbery
The "addresses" field was confusing because it refered to public keys using their P2PKH address. It was included in the return object when needed for backward compatibility. Remove that compatibility now that the -deprecatedrpc=validateaddress option has been removed. New applications should use the 'embedded'->'address' field for P2SH or P2WSH wrapped addresses, and 'pubkeys' for inspecting multisig participants.
2019-04-11generalize bumpfee to add inputs when neededGregory Sanders
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-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-04wallet: Get all balances in one callMarcoFalke
2019-04-04Merge #15596: rpc: Ignore sendmany::minconf as dummy valueMarcoFalke
fabfb79673 doc: Add release notes for 15596 (MarcoFalke) fac1a0fe54 wallet: Remove unused GetLegacyBalance (MarcoFalke) faa3a246e8 scripted-diff: wallet: Rename pcoin to wtx (MarcoFalke) fae5f874d5 rpc: Document that minconf is an ignored dummy value (MarcoFalke) Pull request description: Other RPCs such as `sendtoaddress` don't have this option at all and `sendmany` should by default spend from (lets say) our change. ACKs for commit fabfb7: jnewbery: utACK fabfb79673d6bf9bff5258cd709d8294e77c1764 ryanofsky: utACK fabfb79673d6bf9bff5258cd709d8294e77c1764. Nice writeup! Release notes are only change since previous review. Tree-SHA512: 2526ead2330be7c2beb78b96bc5e55440566c4a3a809bbbd66f5c9fc517f6890affa5d14005dc102644d49679a374510f9507255e870cf88aaa63e429beef658
2019-04-02Merge #15680: Remove resendwallettransactions RPC methodMarcoFalke
ea1a2d8794 [wallet] Remove ResendWalletTransactionsBefore (John Newbery) f5162458cd [rpc] remove resendwallettransactions RPC (John Newbery) Pull request description: Remove resendwallettransactions RPC method This RPC was added for testing wallet rebroadcasts. Since we now have a real test for wallet rebroadcasts, it's no longer needed. The call in wallet_basic.py can be removed because wallet_resendwallettransactions.py tests wallet rebroadcast. ACKs for commit ea1a2d: MarcoFalke: re-utACK ea1a2d8794 promag: utACK ea1a2d8. Tree-SHA512: 48245d947be1a2d2b8c30d2946105818c454a03b70b63534ecadf2144da64dafe1c9527ea670a5f4d1acd05ccdfc6c9be43ca636ee2ba58a8b7a7b2fc7bc88fd
2019-03-29[rpc] remove resendwallettransactions RPCJohn Newbery
This RPC was added for testing wallet rebroadcasts. Since we now have a real test for wallet rebroadcasts, it's no longer needed. The call in wallet_basic.py can be removed because wallet_resendwallettransactions.py tests wallet rebroadcast.
2019-03-28rpc: Fix help text for signtransactionwithXXXTorkel Rogstad
2019-03-21Merge #15625: refactor: Remove unused functionMeshCollider
bb6195e34 refactor: Remove unused function (practicalswift) Pull request description: Last use removed in cad5dd2368109ec398a3b79c8b9e94dfd23f0845. Tree-SHA512: f65bf8f77b9aadbfba39bd80076a4d773eddf685a8a90ef2db549552a3d0ccd426ce3920b2f71954703f64d840fa88349957996d1f64a9c4d3f27a99b4da70e7
2019-03-20refactor: Remove unused functionpracticalswift
2019-03-13rpc: Document that minconf is an ignored dummy valueMarcoFalke
2019-03-06Remove remaining wallet accesses to node globalsRussell Yanofsky
2019-03-05Remove use of CRPCTable::appendCommand in wallet codeRussell Yanofsky
This commit does not change behavior.
2019-03-04Merge #15288: Remove wallet -> node global function callsMarcoFalke
f7efd87c8f Change brace formatting (Russell Yanofsky) a1df1b48a8 Remove use of IsInitialBlockDownload in wallet code (Russell Yanofsky) 1106a6fde4 Remove use of uiInterface.LoadWallet in wallet code (Russell Yanofsky) 318f41fb2c circular-dependencies: Avoid treating some .h/.cpp files as a unit (Russell Yanofsky) d02b34c8a8 Remove use of AcceptToMemoryPool in wallet code (Russell Yanofsky) e2c8ba9f6e Remove uses of InitMessage/Warning/Error in wallet code (Russell Yanofsky) c5e59a96a8 Remove uses of GetAdjustedTime in wallet code (Russell Yanofsky) 6d6bcc77c0 Remove use of g_connman / PushInventory in wallet code (Russell Yanofsky) 00dfb2a440 Remove uses of g_connman in wallet code (Russell Yanofsky) cc3836e8f9 Remove uses of fPruneMode in wallet code (Russell Yanofsky) cc02c796d3 Remove uses of fee globals in wallet code (Russell Yanofsky) 1fb0a4a04e Remove use of CalculateMemPoolAncestors in wallet code (Russell Yanofsky) cd32160af0 Remove use of GetTransactionAncestry in wallet code (Russell Yanofsky) 291276f7f4 Remove use of GetCountWithDescendants in wallet code (Russell Yanofsky) bdc6628683 Remove use of IsRBFOptIn in wallet code (Russell Yanofsky) 80f52a2267 Remove uses of CheckFinalTx in wallet code (Russell Yanofsky) Pull request description: This change removes wallet calls to node functions that access global chain and mempool state. This is the next step in the larger #10973 refactoring change, which removes all other accesses to node global variables from wallet code. Doing this is useful to provide a better defined interface between the wallet and node, and necessary to allow wallet and node code to run in separate processes in #10102. Tree-SHA512: 40dbaf1f59fb22b32e70b054b30ba5638d638aa3240fa30e0f721d53c721cd6138a7ab4d423a24d7d2fda0b956e68d44c733abc2c9259c3d6c9fd6d4be89aa23
2019-02-27[rpc] remove deprecated generate methodSjors Provoost
2019-02-22Change brace formattingRussell Yanofsky
Suggested https://github.com/bitcoin/bitcoin/pull/15288#pullrequestreview-197915100
2019-02-22Remove use of IsInitialBlockDownload in wallet codeRussell Yanofsky
This commit does not change behavior.
2019-02-22Remove use of g_connman / PushInventory in wallet codeRussell Yanofsky
This commit does not change behavior.
2019-02-22Remove uses of g_connman in wallet codeRussell Yanofsky
This commit does not change behavior.
2019-02-22Remove uses of fee globals in wallet codeRussell Yanofsky
This commit does not change behavior.
2019-02-22Remove use of IsRBFOptIn in wallet codeRussell Yanofsky
This commit does not change behavior.
2019-02-22Remove uses of CheckFinalTx in wallet codeRussell Yanofsky
This commit does not change behavior.
2019-02-22Merge #15408: Remove unused TransactionError constantsMarcoFalke
fa9b60c842 Remove unused TransactionError constants (MarcoFalke) Pull request description: Fixup to #14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case. Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future). Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
2019-02-16[Doc] add missing newline to witnessScript in listunspent helpDavid A. Harding
2019-02-14Fetch keys from keypool when private keys are disabledAndrew Chow
When private keys are disabled, still fetch keys from the keypool if the keypool has keys. Those keys come from importing them and adding them to the keypool.
2019-02-15Merge #14021: Import key origin data through descriptors in importmultiMeshCollider
cb3511b9d Add release notes for importing key origin info change (Andrew Chow) 4c75a69f3 Test importing descriptors with key origin information (Andrew Chow) 02d6586d7 Import KeyOriginData when importing descriptors (Andrew Chow) 3d235dff5 Implement a function to add KeyOriginInfo to a wallet (Andrew Chow) eab63bc26 Store key origin info in key metadata (Andrew Chow) 345bff601 Remove hdmasterkeyid (Andrew Chow) bac8c676a Add a method to CWallet to write just CKeyMetadata (Andrew Chow) e7652d3f6 Add WriteHDKeypath function and move *HDKeypath to util/bip32.{h,cpp} (Andrew Chow) c45415f73 Refactor keymetadata writing to a separate method (Andrew Chow) Pull request description: This PR allows for key origin data as defined by the descriptors document to be imported to the wallet when importing a descriptor using `importmulti`. This allows the `walletprocesspsbt` to include the BIP 32 derivation paths for keys that it is watching that are from a different HD wallet. In order to make this easier to use, a new field `hdmasterkeyfingerprint` has been added to `getaddressinfo`. Additionally I have removed `hdmasterkeyid` as was planned. I think that this API change is fine since it was going to be removed in 0.18 anyways. `CKeyMetadata` has also been extended to store key origin info to facilitate this. Tree-SHA512: 9c7794f3c793da57e23c5abbdc3d58779ee9dea3d53168bb86c0643a4ad5a11a446264961e2f772f35eea645048cb60954ed58050002caee4e43cd9f51215097
2019-02-14Store key origin info in key metadataAndrew Chow
Store the master key fingerprint and derivation path in the key metadata. hdKeypath is kept to indicate the seed and for backwards compatibility, but all key derivation path output uses the key origin info instead of hdKeypath.
2019-02-14Merge #14481: Add P2SH-P2WSH support to listunspent RPCWladimir J. van der Laan
6ca836ab3abef5a90df0c3c4e4983f328b1afe00 Add release note for listunspent P2WSH change (MeshCollider) 928beae007fc2f951e79ea307a5e983af4cb3acf Add test for P2SH-P2WSH in signrawtransactionwithkey and listunspent (MeshCollider) 314784a60f18424b004e935aa6e41b824e9645b3 Make listunspent and signrawtransaction RPCs support witnessScript (MeshCollider) Pull request description: This is a reworked version of #11708 after #12427 and the `signrawtransaction` split. For a P2WSH address, listunspent should return the witness script, and for a P2SH-P2WSH address, it should also return the inner witness script (because SignTransaction will automatically wrap it in P2SH if required). Includes a test which also tests the behaviour of #12427, and release note. Tree-SHA512: a8e72cf16930312bf48ec47e44a68f8d7e26664043c1b4cc0983eb25aec4087e511188ff9a0f181cd7b8a0c068c60d7f1e7e3f226b79e8c48890039dcf57f7b7