mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-07 17:00:32 +02:00
wallet: Assert that the wallet is not initialized in LoadWallet
LoadWallet() cannot be run after the wallet has been initialized. So assert that to avoid making this mistake in the future.
This commit is contained in:
@ -2292,6 +2292,8 @@ DBErrors CWallet::LoadWallet()
|
|||||||
{
|
{
|
||||||
LOCK(cs_wallet);
|
LOCK(cs_wallet);
|
||||||
|
|
||||||
|
Assert(m_spk_managers.empty());
|
||||||
|
Assert(m_wallet_flags == 0);
|
||||||
DBErrors nLoadWalletRet = WalletBatch(GetDatabase()).LoadWallet(this);
|
DBErrors nLoadWalletRet = WalletBatch(GetDatabase()).LoadWallet(this);
|
||||||
if (nLoadWalletRet == DBErrors::NEED_REWRITE)
|
if (nLoadWalletRet == DBErrors::NEED_REWRITE)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user