wallet: Correctly log stats for encrypted messages.
Previously creating an encrypted wallet would result in the keypool size incorrectly being reported as 0. See: https://github.com/bitcoin/bitcoin/pull/32636#discussion_r2150021064
This commit is contained in:
1 parent
d8bec61be2
commit
27e021ebc0
1 file changed
+2
-3
@@ -413,7 +413,7 @@ std::shared_ptr<CWallet> CreateWallet(WalletContext& context, const std::string&
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make the wallet
|
// Make the wallet
|
||||||
context.chain->initMessage(_("Loading wallet…"));
|
context.chain->initMessage(_("Creating wallet…"));
|
||||||
std::shared_ptr<CWallet> wallet = CWallet::Create(context, name, std::move(database), wallet_creation_flags, error, warnings);
|
std::shared_ptr<CWallet> wallet = CWallet::Create(context, name, std::move(database), wallet_creation_flags, error, warnings);
|
||||||
if (!wallet) {
|
if (!wallet) {
|
||||||
error = Untranslated("Wallet creation failed.") + Untranslated(" ") + error;
|
error = Untranslated("Wallet creation failed.") + Untranslated(" ") + error;
|
||||||
@@ -447,6 +447,7 @@ std::shared_ptr<CWallet> CreateWallet(WalletContext& context, const std::string&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WITH_LOCK(wallet->cs_wallet, wallet->LogStats());
|
||||||
NotifyWalletLoaded(context, wallet);
|
NotifyWalletLoaded(context, wallet);
|
||||||
AddWallet(context, wallet);
|
AddWallet(context, wallet);
|
||||||
wallet->postInitProcess();
|
wallet->postInitProcess();
|
||||||
@@ -3075,8 +3076,6 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
WITH_LOCK(walletInstance->cs_wallet, walletInstance->LogStats());
|
|
||||||
|
|
||||||
return walletInstance;
|
return walletInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user