From b44b7c03fef01e0b5db704e50762b3d16b3da69e Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Wed, 5 Mar 2025 17:50:52 -0800 Subject: [PATCH] wallet: Write best block record on unload --- src/wallet/wallet.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 5ff3d1433d6..8d379da4e0e 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -164,6 +164,7 @@ bool RemoveWallet(WalletContext& context, const std::shared_ptr& wallet interfaces::Chain& chain = wallet->chain(); std::string name = wallet->GetName(); + WITH_LOCK(wallet->cs_wallet, wallet->WriteBestBlock()); // Unregister with the validation interface which also drops shared pointers. wallet->m_chain_notifications_handler.reset();