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:
Andrew Chow 2023-12-11 15:05:42 -05:00
parent fb0b6ca4e5
commit bd7f5d33e3

View file

@ -2292,6 +2292,8 @@ DBErrors CWallet::LoadWallet()
{
LOCK(cs_wallet);
Assert(m_spk_managers.empty());
Assert(m_wallet_flags == 0);
DBErrors nLoadWalletRet = WalletBatch(GetDatabase()).LoadWallet(this);
if (nLoadWalletRet == DBErrors::NEED_REWRITE)
{