mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-05 18:23:03 +01:00
wallet: Upgrade existing descriptor caches
Add functions to upgrade existing descriptor caches to support the use of last hardened xpub caching.
This commit is contained in:
@@ -884,6 +884,14 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
|
||||
result = DBErrors::CORRUPT;
|
||||
}
|
||||
|
||||
// Upgrade all of the descriptor caches to cache the last hardened xpub
|
||||
// This operation is not atomic, but if it fails, only new entries are added so it is backwards compatible
|
||||
try {
|
||||
pwallet->UpgradeDescriptorCache();
|
||||
} catch (...) {
|
||||
result = DBErrors::CORRUPT;
|
||||
}
|
||||
|
||||
// Set the inactive chain
|
||||
if (wss.m_hd_chains.size() > 0) {
|
||||
LegacyScriptPubKeyMan* legacy_spkm = pwallet->GetLegacyScriptPubKeyMan();
|
||||
|
||||
Reference in New Issue
Block a user