aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletutil.h
AgeCommit message (Collapse)Author
2024-03-20wallet, descspkm: Refactor wallet descriptor generation to standalone funcAndrew Chow
2023-11-05wallet: cache descriptor ID to avoid repeated descriptor string creationSebastian Falbesoner
Right now a wallet descriptor is converted to it's string representation (via `Descriptor::ToString`) repeatedly at different instances: - on finding a `DescriptorScriptPubKeyMan` for a given descriptor (`CWallet::GetDescriptorScriptPubKeyMan`, e.g. used by the `importdescriptors` RPC); the string representation is created once for each spkm in the wallet and at each iteration again for the searched descriptor (`DescriptorScriptPubKeyMan::HasWalletDescriptor`) - whenever `DescriptorScriptPubKeyMan::GetID()` is called, e.g. in `TopUp` or any instances where a descriptor is written to the DB to determine the database key etc. As there is no good reason to calculate a fixed descriptor's string/ID more than once, add the ID as a field to `WalletDescriptor` and calculate it immediately at initialization (or deserialization). `HasWalletDescriptor` is changed to compare the spkm's and searched descriptor's ID instead of the string to take use of that. This speeds up the functional test `wallet_miniscript.py` by a factor of 5-6x on my machine (3m30.95s on master vs. 0m38.02s on PR). The recently introduced "max-size TapMiniscript" test-case introduced a descriptor that takes 2-3 seconds to create a string representation, so the repeated calls to that were significantly hurting the performance.
2023-06-14Merge bitcoin/bitcoin#25634: wallet, tests: Expand and test when the blank ↵Ryan Ofsky
wallet flag should be un/set cdba23db353a1beff831ff4fc83d01ed64e8c2a9 wallet: Document blank flag use in descriptor wallets (Ryan Ofsky) 43310200dce8d450ae5808824af788cefaa5d6db wallet: Ensure that the blank wallet flag is unset after imports (Andrew Chow) e9379f1ffa7a4eebce397f1150317e840655e021 rpc, wallet: Include information about blank flag (Andrew Chow) Pull request description: The `blank` wallet flag is used to indicate that the wallet intentionally does not have any keys, scripts, or descriptors, and it prevents the automatic generation of those things for such a wallet. Once the wallet contains any of those data, it is unnecessary, and possibly incorrect, to have `blank` set. This PR fixes a few places where this was not properly happening. It also adds a test for this unset behavior. ACKs for top commit: S3RK: reACK cdba23db353a1beff831ff4fc83d01ed64e8c2a9 ryanofsky: Code review ACK cdba23db353a1beff831ff4fc83d01ed64e8c2a9. Only change since last review is dropping the commit which makes createwallet RPC set BLANK flag automatically when DISABLE_PRIVATE_KEYS flag is set Tree-SHA512: 85bc2a9754df0531575d5c8f4ad7e8f38dcd50083dc29b3283dacf56feae842e81f34654c5e1781f2dadb0560ff80e454bbc8ca3b2d1fab1b236499ae9abd7da
2023-06-13wallet: Document blank flag use in descriptor walletsRyan Ofsky
2023-05-25Fix `#include`s in `src/wallet`Hennadii Stepanov
2023-03-23refactor: Move fs.* to util/fs.*TheCharlatan
The fs.* files are already part of the libbitcoin_util library. With the introduction of the fs_helpers.* it makes sense to move fs.* into the util/ directory as well.
2022-08-25Implement LegacyScriptPubKeyMan::MigrateToDescriptorAndrew Chow
2022-01-06Add src/wallet/* code to wallet:: namespaceRussell Yanofsky
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-06-24wallet: Upgrade existing descriptor cachesAndrew Chow
Add functions to upgrade existing descriptor caches to support the use of last hardened xpub caching.
2021-02-23wallet: add external_signer flagSjors Provoost
2020-12-31scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
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-10-19wallet: Add GetClosestWalletFeature functionAndrew Chow
Given a version number, get the closest supported WalletFeature for a version number.
2020-10-19wallet: Add utility method for CanSupportFeatureAndrew Chow
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-05-24Convert wallet to new serializationPieter Wuille
2020-04-27wallet: Make sure no WalletDescriptor members are uninitialized after ↵practicalswift
construction
2020-04-23Introduce WalletDescriptor classAndrew Chow
WalletDescriptor is a Descriptor with other wallet metadata
2020-04-23Add WALLET_FLAG_DESCRIPTORSAndrew Chow
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-10-25Move wallet enums to walletutil.hAndrew Chow
2018-10-25wallet: Add WalletLocation utility classJoão Barbosa
2018-10-18wallet: Add ListWalletDir utilityJoão Barbosa
ListWalletDir returns all available wallets in the current wallet directory. Based on MeshCollider work in pull #11485.
2018-07-27Update copyright headers to 2018DrahtBot
2018-03-22Fix missing or inconsistent include guardspracticalswift
2017-12-13Cleanups for walletdir PRMeshCollider
2017-11-18Add -walletdir parameter to specify custom wallet dirMeshCollider