Skip to content

Commit bd7f5d3

Browse files
committed
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.
1 parent fb0b6ca commit bd7f5d3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,6 +2292,8 @@ DBErrors CWallet::LoadWallet()
22922292
{
22932293
LOCK(cs_wallet);
22942294

2295+
Assert(m_spk_managers.empty());
2296+
Assert(m_wallet_flags == 0);
22952297
DBErrors nLoadWalletRet = WalletBatch(GetDatabase()).LoadWallet(this);
22962298
if (nLoadWalletRet == DBErrors::NEED_REWRITE)
22972299
{

0 commit comments

Comments
 (0)