From fb0b6ca4e5d981cf58bf23ae2993117f171608e8 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Fri, 8 Dec 2023 17:49:51 -0500 Subject: tests, bench: Remove incorrect LoadWallet() calls LoadWallet() must only be called immediately after a CWallet is constructed, or not at all. Doing so after any other CWallet member functions have been called may cause pointers and other objects setup by other those functions to become invalidated. Since these tests and benchmarks are using completely new wallets with mock databases, it's not necessary to call LoadWallet() anyways, so these can be dropped. --- src/wallet/test/util.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/wallet/test') diff --git a/src/wallet/test/util.cpp b/src/wallet/test/util.cpp index ad8613d515..cbf3ccd1ec 100644 --- a/src/wallet/test/util.cpp +++ b/src/wallet/test/util.cpp @@ -24,7 +24,6 @@ std::unique_ptr CreateSyncedWallet(interfaces::Chain& chain, CChain& cc LOCK2(wallet->cs_wallet, ::cs_main); wallet->SetLastBlockProcessed(cchain.Height(), cchain.Tip()->GetBlockHash()); } - wallet->LoadWallet(); { LOCK(wallet->cs_wallet); wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS); -- cgit v1.2.3