aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
AgeCommit message (Collapse)Author
2020-12-19Replace boost::optional with std::optionalMarcoFalke
2020-12-19Remove unused MakeOptionalMarcoFalke
The only use was to work around a compiler warning in an ancient compiler, which we no longer support.
2020-12-17wallet: Add missing check for -descriptors wallet tool optionMarcoFalke
2020-12-17wallet: Pass ArgsManager into ExecuteWalletToolFunc instead of using globalMarcoFalke
2020-12-17Merge #19137: wallettool: Add dump and createfromdump commandsMarcoFalke
23cac24dd3f2aaf88aab978e7ef4905772815cd2 tests: Test bitcoin-wallet dump and createfromdump (Andrew Chow) a88c320041bd1cd1786b2dfd9ab698a67c2a57c6 wallettool: Add createfromdump command (Andrew Chow) e1e7a90d5f0616a46ffadd62a9f1c65406cca6b4 wallettool: Add dump command (Andrew Chow) Pull request description: Adds two commands to the `bitcoin-wallet` tool: `dump` and `createfromdump`. These commands will be useful for a wallet storage migration in the future. It is also generally useful to have a storage agnostic dump like this. These commands are similar to BDB's `db_dump` and `db_load` tools. This can also be useful for manual construction of a wallet file for tests. `dump` outputs every key-value pair from the wallet as comma separated hex. Each key-value pair is on its own line with the key and value in hex separated by a comma. This is output to the file specified by the new `-dumpfile` option. `createfromdump` takes a file produced by `dump` and creates a new wallet file with exactly the records specified in that file. A new option `-dumpfile` is added to the wallet tool. When used with `dump`, the records will be written to the specified file. When used with `createfromdump`, the file is read and the key-value pairs constructed from it. `createfromdump` requires `-dumpfile`. A simple round-trip test is added to the `tool_wallet.py`. This PR is based on #19334, ACKs for top commit: Sjors: re-utACK 23cac24 MarcoFalke: re review ACK 23cac24dd3f2aaf88aab978e7ef4905772815cd2 only change is rebase and removing useless shared_ptr wrapper 🎼 ryanofsky: Code review ACK 23cac24dd3f2aaf88aab978e7ef4905772815cd2. Only changes since last review rebase and changing a pointer to a reference Tree-SHA512: 2d63cf62baca3d16495aa698dc02f7d889c81b41015e9c92c23c275bb4a690fc176d351c3fd7f310bd6b17f5a936cc9be694cbecd702af741b96c0f530e72fa2
2020-12-17Merge #20635: fix misleading comment about call to non-existing functionWladimir J. van der Laan
cc3044ccdbefa9fae58d1762477e377883b39c5e fix misleading comment about call to non-existing function (pox) Pull request description: The comment seems to be describing the subsequent call to `SyncTransaction` but refers to it as `SyncNotifications`, which is not any function currently in the codebase. It's best to just remove the "what" aspect of the comment and focus on the "why", which also reduces the risk of similar documentation errors in the future, in case the function ever gets renamed, for example. ACKs for top commit: laanwj: ACK cc3044ccdbefa9fae58d1762477e377883b39c5e Tree-SHA512: 882ff17836ef585a603dc504f3dd21f56f682e49b28a0998f23fd16025826fbb083b7978db3ee70d0e0ff2c86fd6c3fd99a2361e5d45c765fdc5822c5f14c0a7
2020-12-16Merge #20575: Do not run functions with necessary side-effects in assert()Wladimir J. van der Laan
5021810650afc3073c2af6953ff046ad4d27a1fc Make CanFlushToDisk a const member function (practicalswift) 281cf995547f7683a9e9186bc6384a9fb6035d10 Do not run functions with necessary side-effects in assert() (practicalswift) Pull request description: Do not run functions with necessary side-effects in `assert()`. ACKs for top commit: laanwj: Code review ACK 5021810650afc3073c2af6953ff046ad4d27a1fc sipa: utACK 5021810650afc3073c2af6953ff046ad4d27a1fc theStack: Code Review ACK 5021810650afc3073c2af6953ff046ad4d27a1fc 🟢 Tree-SHA512: 38b7faccc2f16a499f9b7b1b962b49eb58580b2a2bbf63ea49dcc418a5ecc8f21a0972fa953f66db9509c7239af67cfa2f9266423fd220963d091034d7332b96
2020-12-16wallettool: Add createfromdump commandAndrew Chow
Creates a new wallet file using the dump file produced by the dump command
2020-12-16wallettool: Add dump commandAndrew Chow
Adds a new dump command to bitcoin-wallet which prints out all of the wallet's records in hex.
2020-12-16Merge #20365: wallettool: add parameter to create descriptors walletMarcoFalke
173cc9b7be335b5dd2cc1bb112dfa6ec5c13ec12 test: walettool create descriptors (Ivan Metlushko) 345e88eecf1b28607d5da3af38e19794a8a115ce wallettool: add param to create descriptors wallet (Ivan Metlushko) 6d3af3ab627096a824cb6a7ca1ebeddc7530361c wallettool: pass in DatabaseOptions into MakeWallet (Ivan Metlushko) Pull request description: Rationale: expose and promote descriptor wallets in more places; make cli tool more consistent with `createwallet` rpc. Add `-descriptors` parameter which is off by default. When specified it will create a new descriptors wallet with sqlite backend, which is consistent with `createwallet` rpc. This PR is based on a suggestion from **ryanofsky** https://github.com/bitcoin/bitcoin/pull/19137#discussion_r516779603 Example: ``` $ ./src/bitcoin-wallet -wallet=fewty -descriptors create Topping up keypool... Wallet info =========== Name: fewty Format: sqlite Descriptors: yes Encrypted: no HD (hd seed available): yes Keypool Size: 6000 Transactions: 0 Address Book: 0 ``` ``` $ ./src/bitcoin-wallet -wallet=fewty create Topping up keypool... Wallet info =========== Name: fewty Format: bdb Descriptors: no Encrypted: no HD (hd seed available): yes Keypool Size: 2000 Transactions: 0 Address Book: 0 ``` ACKs for top commit: achow101: ACK 173cc9b7be335b5dd2cc1bb112dfa6ec5c13ec12 ryanofsky: Code review ACK 173cc9b7be335b5dd2cc1bb112dfa6ec5c13ec12. This seems pretty nicely implemented now, with opportunities to clean up more and dedup later MarcoFalke: Concept ACK 173cc9b7be335b5dd2cc1bb112dfa6ec5c13ec12 🌠 Tree-SHA512: cc32ba336ff709de2707ee15f495b4617908e8700ede8401a58e894f44cda485c544d644023c9a6604d88a62db9d92152383ee2e8abf691688c25cf6e222c622
2020-12-13Merge #20588: Remove unused and confusing CTransaction constructorfanquake
fac39c198324715565897f4240709340477af0bf wallet: document that tx in CreateTransaction is purely an out-param (MarcoFalke) faac31521bb7ecbf999541cf918d3750ff589de4 Remove unused and confusing CTransaction constructor (MarcoFalke) Pull request description: The constructor is confusing and dangerous (as explained in the TODO), fix that by removing it. ACKs for top commit: laanwj: Code review ACK fac39c198324715565897f4240709340477af0bf promag: Code review ACK fac39c198324715565897f4240709340477af0bf. theStack: Code review ACK fac39c198324715565897f4240709340477af0bf Tree-SHA512: e0c8cffce8d8ee0166b8e1cbfe85ed0657611e26e2af0d69fde70eceaa5d75cbde3eb489af0428fe4fc431360b4c791fb1cc21b8dee7d4c7a4f17df00836229d
2020-12-12Merge #20275: wallet: List all wallets in non-SQLite and non-BDB buildsMarcoFalke
f3d870fc2271bf45e0269e5ae135bced1a26f620 wallet: List all wallets in non-SQLite or non-BDB builds (Russell Yanofsky) d70dc89e78ee6355e0bc37cc36cfc04ef7a86885 refactor: Consolidate redundant wallet database path and exists functions (Russell Yanofsky) 6a7a63644cd2fc56538d323cc0d5c1d7945247fd refactor: Drop call to GetWalletEnv in wallet salvage code (Russell Yanofsky) 6ee9cbdd18a70894f89dd268c276d5eb47a34827 refactor: Replace ListWalletDir() function with ListDatabases() (Russell Yanofsky) 5aaeb6cf877055c47fa2bbd2ea5e8d3d2033933b MOVEONLY: Move IsBDBFile, IsSQLiteFile, and ListWalletDir (Russell Yanofsky) Pull request description: This PR does not change behavior when bitcoin is built normally with both the SQLite and BDB libraries. It just makes non-SQLite and non-BDB builds more similar to the normal build. Specifically: - It makes wallet directory lists always include all wallets so wallets don't appear missing depending on the build. - It now triggers specific "Build does not support SQLite database format" and "Build does not support Berkeley DB database format" errors if a wallet can't be loaded instead of the more ambiguous and scary "Data is not in recognized format" error. Both changes are implemented in the last commit. The previous commits are just refactoring cleanups that make the last commit possible and consolidate and reduce code. ACKs for top commit: achow101: ACK f3d870fc2271bf45e0269e5ae135bced1a26f620 promag: Tested ACK f3d870fc2271bf45e0269e5ae135bced1a26f620. Tested a --without-sqlite build with sqlite wallets. Tree-SHA512: 029ad21559dbc338b5f351d05113c51bc25bce830f4f4e18bcd82287bc528275347a60249da65b91d252632aeb70b25d057bd59c704bfcaafb9f790bc5b59762
2020-12-12fix misleading comment about call to non-existing functionpox
2020-12-10test: Fix inconsistent lock order in wallet_tests/CreateWalletHennadii Stepanov
2020-12-10Merge #20573: wallet, bugfix: allow send with string fee_rate amountsMarcoFalke
6fa72ceb8021c3b5aea62f6cfe92665c29212923 test: add coverage for passing fee rate as a string (Jon Atack) ce207d6b93d35bc02fcd2dd28f1fd95869261d43 wallet, bugfix: allow send to take string fee rate values (Jon Atack) Pull request description: RPC send currently only accepts fee rates as numbers, which is a user-facing bug. It should accept fee rates as an amount, e.g. a string or a number, as documented in its help and like sendtoaddress, sendmany, fundrawtransaction, walletcreatefundedpsbt, and bumpfee. Provide a fix and regression test coverage. ACKs for top commit: MarcoFalke: review ACK 6fa72ceb8021c3b5aea62f6cfe92665c29212923 achow101: Code review ACK 6fa72ceb8021c3b5aea62f6cfe92665c29212923 promag: Code review ACK 6fa72ceb8021c3b5aea62f6cfe92665c29212923. Tree-SHA512: 735f9269cb1b81953764b5283449c0b154bd62de034225be5bcedc515c84faf767fe8fe0741008679fe412922c847b00d116cb11aab775236b779c847ba87167
2020-12-07test: Remove no longer needed MakeChain callsRussell Yanofsky
These calls are no longer needed after edc316020e8270dafc5e31465d532baebdafd3dd from #19098 which started instantiating BasicTestingSetup.m_node.chain Patch from MarcoFalke <falke.marco@gmail.com> in https://github.com/bitcoin/bitcoin/pull/19425#discussion_r526701954 Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2020-12-07wallet: document that tx in CreateTransaction is purely an out-paramMarcoFalke
2020-12-07Remove unused and confusing CTransaction constructorMarcoFalke
2020-12-07refactor: Replace uses ChainActive() in interfaces/chain.cppRussell Yanofsky
Suggested https://github.com/bitcoin/bitcoin/pull/19425#discussion_r456236407
2020-12-07refactor: Get rid of more redundant chain methodsRussell Yanofsky
This just drops three interfaces::Chain methods replacing them with other calls. Motivation for removing these chain methods: - Need to get rid of findFirstBlockWithTimeAndHeight for #10102, which doesn't support overloaded methods - Followup from https://github.com/bitcoin/bitcoin/pull/16426#discussion_r412487403 - phantomcircuit comments about findNextBlock test http://www.erisian.com.au/bitcoin-core-dev/log-2020-06-06.html#l-214 Behavior is not changing in any way here. A TODO comment in ScanForWalletTransactions was removed, but just because it was invalid (see https://github.com/bitcoin/bitcoin/pull/19195#discussion_r448020762), not because it was implemented.
2020-12-06Do not run functions with necessary side-effects in assert()practicalswift
2020-12-06Don't make "in" parameters look like "out"/"in-out" parameters: pass by ref ↵practicalswift
to const instead of ref to non-const
2020-12-04wallet, bugfix: allow send to take string fee rate valuesJon Atack
2020-12-04wallet: List all wallets in non-SQLite or non-BDB buildsRussell Yanofsky
This commit does not change behavior when bitcoin is built normally with both the SQLite and BDB libraries. It just makes non-SQLite and non-BDB builds more similar to the normal build. Specifically: - It makes wallet directory lists always include all wallets so wallets don't appear missing depending on the build. - It now triggers specific "Build does not support SQLite database format" and "Build does not support Berkeley DB database format" errors if a wallet can't be loaded instead of the more ambiguous and scary "Data is not in recognized format" error.
2020-12-04refactor: Consolidate redundant wallet database path and exists functionsRussell Yanofsky
No change in behavior. Just remove a little bit of code, reduce macro usage, remove duplicative functions, and make BDB and SQLite implementations more consistent with each other.
2020-12-04refactor: Drop call to GetWalletEnv in wallet salvage codeRussell Yanofsky
No observable change in behavior. This just avoids a redundant environment lookup. Motivation is to be able to simplify the GetWalletEnv implementation in an upcoming commit.
2020-12-04refactor: Replace ListWalletDir() function with ListDatabases()Russell Yanofsky
No change to behavior. This is just cleanup after previous MOVEONLY commit to make db.h list function fit conventions of surrounding functions.
2020-12-04MOVEONLY: Move IsBDBFile, IsSQLiteFile, and ListWalletDirRussell Yanofsky
This commit does not change to any code and behavior. It it is easily reviewed with the --color-moved=dimmed_zebra git diff option. Motivation for this change is to: - Consolidate redundant functions IsBDBFile /ExistsBerkeleyDatabase / SplitWalletPath, and IsSQLiteFile / ExistsSQLiteDatabase in the next commits - Detect SQLite wallets consistently regardless whether bitcoin is built with SQLite support in the next commits - Avoid attempting to open SQLite databases with the BDB library when bitcoin is built without SQLite support in the next commits
2020-12-04refactor: Use C++17 std::array where possibleMarcoFalke
2020-12-02Merge #20530: lint, refactor: Update cppcheck linter to c++17 and improve ↵fanquake
explicit usage 1e62350ca20898189904a88dfef9ea11ddcd8626 refactor: Improve use of explicit keyword (Fabian Jahr) c502a6dbfb854ca827a5a3925394f9e09d29b898 lint: Use c++17 std in cppcheck linter (Fabian Jahr) Pull request description: I found the `extended-lint-cppcheck` linter still uses `std=c++11` when reviewing #20471. The only difference in the output after this change is one line is missing: ``` src/script/descriptor.cpp:159:5: warning: Struct 'PubkeyProvider' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] ``` After some digging, I am still not sure why this one is ignored with c++17 when 40 other`noExplicitConstructor` warnings were still appearing. In the second commit, I fix these warnings, adding `explicit` where appropriate and adding fixes to ignore otherwise. ACKs for top commit: practicalswift: cr ACK 1e62350ca20898189904a88dfef9ea11ddcd8626: patch looks correct! MarcoFalke: review ACK 1e62350ca20898189904a88dfef9ea11ddcd8626 Tree-SHA512: dff7b324429a57160e217cf38d9ddbb6e70c6cb3d3e3e0bd4013d88e07afc2292c3df94d0acf7122e9d486322821682ecf15c8f2724a78667764c05d47f89a12
2020-12-02Merge #19980: refactor: Some wallet cleanupsfanquake
9b74461fa293453a9eb0b1717b30b3f7fa778d91 refactor: Assert before dereference in CWallet::GetDatabase (João Barbosa) 021feb3187b207d511561c1f0ffd7f9e5e0c9c1d refactor: Drop redudant CWallet::GetDBHandle (João Barbosa) Pull request description: ACKs for top commit: achow101: Code Review ACK 9b74461fa293453a9eb0b1717b30b3f7fa778d91 meshcollider: utACK 9b74461fa293453a9eb0b1717b30b3f7fa778d91 ryanofsky: Code review ACK 9b74461fa293453a9eb0b1717b30b3f7fa778d91. Changes since last review: rebasing due to conflict, dropping wallet path commit c6a5cd7a64c78b162f545a3467d0fea7dcaadfcc as suggested in discussion, making GetDatabase() const in the earlier commit. Giving more descriptive title like Tree-SHA512: 68cf3b5e9fe0acb3a5cd081086629989f213f1904cc344e5775767b56759a7d905b1e1c303afbe40f172ff81bf07f3719b59d8f6ec2de3fdd53cd0e2d220fb25
2020-12-01refactor: Improve use of explicit keywordFabian Jahr
2020-12-01Merge #20494: refactor: Move node and wallet code out of src/interfacesMarcoFalke
629a9299b2a7241a3fa7d597cb34abcbe1af9255 Move WalletImpl from interfaces/wallet.cpp to wallet/interfaces.cpp (Russell Yanofsky) 2a26771d8161d30be1853a35acfee588cce03634 Move ChainImpl from interfaces/chain.cpp to node/interfaces.cpp (Russell Yanofsky) 12bd0fc9d70333c54c83ebb08c734272dbd330c2 Move NodeImpl from interfaces/node.cpp to node/interfaces.cpp (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- Move `NodeImpl` from `interfaces/node.cpp` to `node/interfaces.cpp` Move `ChainImpl` from `interfaces/chain.cpp` to `node/interfaces.cpp` Move `WalletImpl` from `interfaces/wallet.cpp` to `wallet/interfaces.cpp` No changes to any classes (can review with `git diff --color-moved=dimmed_zebra`) Motivation for this change is to move node and wallet code to respective directories where it might fit in better than `src/interfaces/`, but also to remove all unnecessary code from `src/interfaces/` to unblock #19160 review, which has been hung up partially because of code organization. Building on top of this PR, #19160 should now be able to organize interface implementations more understandably in `src/node/` `src/wallet/` `src/ipc/` and `src/init/` directories instead of having so much functionality all in `src/interfaces/` ACKs for top commit: promag: Code review ACK 629a9299b2a7241a3fa7d597cb34abcbe1af9255. MarcoFalke: review ACK 629a9299b2a7241a3fa7d597cb34abcbe1af9255 🔺 Tree-SHA512: 87c2b8fd51519bbd4e5ad3539a79debcf88c3bf021eb28c63f3f555186538b62a0c4cc1a3f07cfb4ff13aea8b0b2fdde505d81f22a5e5fd12a6e375b55a92ab8
2020-11-28Merge #20448: RPC/Wallet: unloadwallet: Allow specifying wallet_name param ↵MarcoFalke
matching RPC endpoint wallet 89bdad5b25ae4ac03a486f729a5b58ae6f21946d RPC/Wallet: unloadwallet: Allow specifying wallet_name param matching RPC endpoint (Luke Dashjr) Pull request description: Allow specifying the `wallet_name` param to `unloadwallet` on RPC wallet endpoints, so long as it matches the endpoint wallet. ACKs for top commit: jonatack: ACK 89bdad5b25ae4ac03a486f729a5b58ae6f21946d MarcoFalke: review ACK 89bdad5b25ae4ac03a486f729a5b58ae6f21946d Tree-SHA512: efb399c33f7b5596870a26a8680f453ca47aa7a6db4e550f9435d13044f1c4bad0ae11e8f0205213409d08b75c4188c3be782e54aafab1f65b97eb8cf5c252a9
2020-11-25Merge #20403: wallet: upgradewallet fixes, improvements, test coverageMarcoFalke
3eb6f8b2e61c24a22ea9396d86672307845f35eb wallet (not for backport): improve upgradewallet error messages (Jon Atack) ca8cd893bb56bf5d455154b0498b1f58f77d20ed wallet: fix and improve upgradewallet error responses (Jon Atack) 99d56e357159c7154f69f28cb5587c5ca20d6594 wallet: fix and improve upgradewallet result responses (Jon Atack) 2498b04ce88696a3216fc38b7d393906b733e8b1 Don't upgrade to HD split if it is already supported (Andrew Chow) c46c18b788cb0862aafbb116fd37936cbed6a431 wallet: refactor GetClosestWalletFeature() (Jon Atack) Pull request description: This follows up on #18836 and #20282 to fix and improve the as-yet unreleased `upgradewallet` feature and also implement review follow-up in https://github.com/bitcoin/bitcoin/pull/18836#discussion_r519328607. This PR fixes 4 upgradewallet issues: - this bug: https://github.com/bitcoin/bitcoin/pull/20403#discussion_r526063920 - it returns nothing in the absence of an RPC error, which isn't reassuring for users - it returns the same thing both in the case of a successful upgrade and when no upgrade took place - the error message object is currently dead code This PR fixes the above and provides: ...user feedback to not silently return without upgrading ``` { "wallet_name": "disable private keys", "previous_version": 169900, "current_version": 169900, "result": "Already at latest version. Wallet version unchanged." } ``` ...better feedback after successfully upgrading ``` { "wallet_name": "watch-only", "previous_version": 159900, "current_version": 169900, "result": "Wallet upgraded successfully from version 159900 to version 169900." } ``` ...helpful error responses ``` { "wallet_name": "blank", "previous_version": 169900, "current_version": 169900, "error": "Cannot downgrade wallet from version 169900 to version 159900. Wallet version unchanged." } { "wallet_name": "blank", "previous_version": 130000, "current_version": 130000, "error": "Cannot upgrade a non HD split wallet from version 130000 to version 169899 without upgrading to support pre-split keypool. Please use version 169900 or no version specified." } ``` updated help: ``` upgradewallet ( version ) Upgrade the wallet. Upgrades to the latest version if no version number is specified. New keys may be generated and a new wallet backup will need to be made. Arguments: 1. version (numeric, optional, default=169900) The version number to upgrade to. Default is the latest wallet version. Result: { (json object) "wallet_name" : "str", (string) Name of wallet this operation was performed on "previous_version" : n, (numeric) Version of wallet before this operation "current_version" : n, (numeric) Version of wallet after this operation "result" : "str", (string, optional) Description of result, if no error "error" : "str" (string, optional) Error message (if there is one) } ``` ACKs for top commit: achow101: ACK 3eb6f8b MarcoFalke: review ACK 3eb6f8b2e61c24a22ea9396d86672307845f35eb 🛡 Tree-SHA512: b767314069e26b5933b123acfea6aa40708507f504bdb22884da020a4ca1332af38a7072b061e36281533af9f4e236d94d3c129daf6fe5b55241127537038eed
2020-11-25Merge #20410: wallet: Do not treat default constructed types as None-typeMarcoFalke
fa69c2c78455fd0dc436018fece9ff7fc83a180d wallet: Do not treat default constructed types as None-type (MarcoFalke) fac4e136fa3d0fab7fde900a6be921313e16e7a6 refactor: Change pointer to reference because it can not be null (MarcoFalke) Pull request description: Equating `0==None` and `""==None` is confusing, unneeded and undocumented ACKs for top commit: jonatack: ACK fa69c2c78455fd0dc436018fece9ff7fc83a180d achow101: ACK fa69c2c78455fd0dc436018fece9ff7fc83a180d Sjors: tACK fa69c2c78455fd0dc436018fece9ff7fc83a180d modulo `unset` Tree-SHA512: c4c8d0ad80c6697621d356a9545caf28ca2facc82bb2fa8e70eceb52372d25f0685237c73688c4b01da0e75d213c77c0d45011a8bdfe81ea783d85f045786dac
2020-11-24Move WalletImpl from interfaces/wallet.cpp to wallet/interfaces.cppRussell Yanofsky
2020-11-24Merge #20462: RPC/Wallet: unloadwallet: Clarify docs/error when both the RPC ↵MarcoFalke
request and wallet_name parameter specify a wallet b1f59d55d920d2b35269b474762f94fec87bfb16 RPC/Wallet: unloadwallet: Clarify docs/error when both the RPC endpoint and wallet_name parameter specify a wallet (Luke Dashjr) Pull request description: Just documentation clarifications from #20448 ACKs for top commit: MarcoFalke: review ACK b1f59d55d920d2b35269b474762f94fec87bfb16 jonatack: re-ACK b1f59d55d920d2b35269b474762f94fec87bfb16 per `git diff e8303a0 b1f59d5` Tree-SHA512: ac068b0aa7ceed49496367fdd9425b59dbba18b56e89b26afc22a6c8ece51f0b92a169cacd55740b1cadab2b32f4f8e8700e609066ab7e59d3b53c7891da585e
2020-11-24RPC/Wallet: unloadwallet: Allow specifying wallet_name param matching RPC ↵Luke Dashjr
endpoint
2020-11-24RPC/Wallet: unloadwallet: Clarify docs/error when both the RPC endpoint and ↵Luke Dashjr
wallet_name parameter specify a wallet
2020-11-23Merge #20202: wallet: Make BDB support optionalWladimir J. van der Laan
d52f502b1ea1cafa7d58c5517f01dba26ecb7269 Fix mock SQLiteDatabases (Andrew Chow) 99309ab3e96a290359b84f9b657c5115aa3470dd Allow disabling BDB in configure with --without-bdb (Andrew Chow) ee47f11f7399ec3a4330ea1f2fc388c7e32959d6 GUI: Force descriptor wallets when BDB is not compiled (Andrew Chow) 71e40b33bd1e72ccf5d82e1d3f8b481f8e965492 RPC: Require descriptors=True for createwallet when BDB is not compiled (Andrew Chow) 6ebc41bf9cb0184554923e84e1935195d356f2b3 Enforce salvage is only for BDB wallets (Andrew Chow) a58b719cf75e2d97205ec260bcff0d4780fe4fb8 Do not compile BDB things when USE_BDB is defined (Andrew Chow) b33af48210c117a734fc3e1bebeb1c2057645775 Include wallet/bdb.h where it is actually being used (Andrew Chow) Pull request description: Adds a `--without-bdb` option to `configure` which disables the compilation of the BDB stuff. Legacy wallets will not be created when BDB is not compiled. A legacy-sqlite wallet can be loaded, but we will not create them. Based on #20156 to resolve the situation where both `--without-sqlite` and `--without-bdb` are provided. In that case, the wallet is disabled and `--disable-wallet` is effectively set. ACKs for top commit: laanwj: Code review ACK d52f502b1ea1cafa7d58c5517f01dba26ecb7269 Tree-SHA512: 5a92ba7a542acc2e27003e9d4e5940e0d02d5c1f110db06cdcab831372bfd83e8d89c269caff31dd5bff062c1cf5f04683becff12bd23a33be731676f346553d
2020-11-20Use the correct incremental fee constant in bumpfee helpJon Atack
and remove redundant units ("Must be at least 1.000 sat/vB sat/vB" -> "1.00 sat vB")
2020-11-20Allow zero-fee fundrawtxn and walletcreatefundedpsbt callsJon Atack
A check to raise an error on zero-fee txns was mistakenly extended in commit a0d4957 from the bumpfee and send{toaddress, many} RPCs to also include fundrawtransaction and walletcreatefundedpsbt. This commit overrides zero fee rate checking for these two RPCs, not only for the feeRate (BTC/kvB) arg to return to previous behavior, but also for the new fee_rate (sat/vB) arg.
2020-11-19wallet (not for backport): improve upgradewallet error messagesJon Atack
2020-11-19wallet: fix and improve upgradewallet error responsesJon Atack
2020-11-19wallet: fix and improve upgradewallet result responsesJon Atack
2020-11-19wallet: Do not treat default constructed types as None-typeMarcoFalke
2020-11-19Merge #15710: wallet: Catch ios_base::failure specificallyWladimir J. van der Laan
7486e2771e7b5d6fa84df6e954be76350c84e220 Tests: Unit test related to WalletDB ReadKeyValue (Bushstar) 32def8d1c29e0855fe5429687acabd2f29119316 Catch ios_base::failure specifically (Peter Bushnell) Pull request description: In https://github.com/bitcoin/bitcoin/pull/2950 a hash of the pubkey and private was added to speed up key import, this was made backwards compatible by reading the hash in a try block with an ellipses catch all in case the hash was not present. CDataStream::read() specifically throws std::ios_base::failure, backwards compatibility expects only that error to be thrown, if something else gets thrown we should not be catching it. The change in this commit is to catch that exception only. If any other exception is thrown other than std::ios_base::failure it will be caught by the wider try block and an error written to the log and/or console. CDataStream::read() throwing std::ios_base::failure. https://github.com/bitcoin/bitcoin/blob/2c364fde423e74b4e03ebcff4582a9db7a6c4e4b/src/streams.h#L191 Wider catch statements that pick up all others exceptions other than ios_base::failure. https://github.com/bitcoin/bitcoin/blob/2c364fde423e74b4e03ebcff4582a9db7a6c4e4b/src/wallet/walletdb.cpp#L425 https://github.com/bitcoin/bitcoin/blob/2c364fde423e74b4e03ebcff4582a9db7a6c4e4b/src/wallet/walletdb.cpp#L430 ACKs for top commit: laanwj: Code review ACK 7486e2771e7b5d6fa84df6e954be76350c84e220 Tree-SHA512: 5364bf935af8ec603bf5b8fef8c23b5cdaa4fe3506090cff988413221f2eaa99f7a91929afb42a35f8881ce2328744a0d32052da51ca0a5b2e65b6809e97f604
2020-11-19Don't upgrade to HD split if it is already supportedAndrew Chow
It is unnecessary to upgrade to FEATURE_HD_SPLIT if this feature is already supported by the wallet. Because upgrading to FEATURE_HD_SPLIT actually requires upgrading to FEATURE_PRE_SPLIT_KEYPOOL, users would accidentally be upgraded to FEATURE_PRE_SPLIT_KEYPOOL instead of nothing being done. Fixes the issue described at https://github.com/bitcoin/bitcoin/pull/20403#discussion_r526063920
2020-11-18Fix mock SQLiteDatabasesAndrew Chow