From 7379a54ec416c8c0a029cc41835a23d42cb6d800 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Fri, 17 Feb 2023 19:54:47 -0500 Subject: [PATCH] bench: Remove incorrect LoadWallet call in WalletBalance The WalletBalance benchmarks would incorrectly call LoadWallet after the wallet has been setup. LoadWallet expects to be the first thing that is called and for the CWallet to be in a fresh state. When it is not, it results in bogus pointers which can cause segfaults during this benchmark. --- src/bench/wallet_balance.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bench/wallet_balance.cpp b/src/bench/wallet_balance.cpp index cafe7a0c60..509716c716 100644 --- a/src/bench/wallet_balance.cpp +++ b/src/bench/wallet_balance.cpp @@ -26,7 +26,6 @@ static void WalletBalance(benchmark::Bench& bench, const bool set_dirty, const b LOCK(wallet.cs_wallet); wallet.SetWalletFlag(WALLET_FLAG_DESCRIPTORS); wallet.SetupDescriptorScriptPubKeyMans(); - if (wallet.LoadWallet() != DBErrors::LOAD_OK) assert(false); } auto handler = test_setup->m_node.chain->handleNotifications({&wallet, [](CWallet*) {}});