File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -320,8 +320,6 @@ void LegacyScriptPubKeyMan::UpgradeKeyMetadata()
320320 }
321321 }
322322 }
323- batch.reset (); // write before setting the flag
324- m_storage.SetWalletFlag (WALLET_FLAG_KEY_ORIGIN_METADATA);
325323}
326324
327325bool LegacyScriptPubKeyMan::IsHDEnabled () const
Original file line number Diff line number Diff line change @@ -249,10 +249,15 @@ const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const
249249
250250void CWallet::UpgradeKeyMetadata ()
251251{
252+ if (IsLocked () || IsWalletFlagSet (WALLET_FLAG_KEY_ORIGIN_METADATA)) {
253+ return ;
254+ }
255+
252256 if (m_spk_man) {
253257 AssertLockHeld (m_spk_man->cs_wallet );
254258 m_spk_man->UpgradeKeyMetadata ();
255259 }
260+ SetWalletFlag (WALLET_FLAG_KEY_ORIGIN_METADATA);
256261}
257262
258263bool CWallet::Unlock (const SecureString& strWalletPassphrase, bool accept_no_keys)
You can’t perform that action at this time.
0 commit comments