| 548 | } |
| 549 | |
| 550 | void CWallet::UpgradeDescriptorCache() |
| 551 | { |
| 552 | if (!IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS) || IsLocked() || IsWalletFlagSet(WALLET_FLAG_LAST_HARDENED_XPUB_CACHED)) { |
| 553 | return; |
| 554 | } |
| 555 | |
| 556 | for (ScriptPubKeyMan* spkm : GetAllScriptPubKeyMans()) { |
| 557 | DescriptorScriptPubKeyMan* desc_spkm = dynamic_cast<DescriptorScriptPubKeyMan*>(spkm); |
| 558 | desc_spkm->UpgradeDescriptorCache(); |
| 559 | } |
| 560 | SetWalletFlag(WALLET_FLAG_LAST_HARDENED_XPUB_CACHED); |
| 561 | } |
| 562 | |
| 563 | /* Given a wallet passphrase string and an unencrypted master key, determine the proper key |
| 564 | * derivation parameters (should take at least 100ms) and encrypt the master key. */ |