aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@pm.me>2022-11-10 16:09:41 -0500
committerJames O'Beirne <james.obeirne@pm.me>2023-09-30 06:38:47 -0400
commitfbe0a7d7ca680358237b6c2369b3fd2b43221113 (patch)
treea706773d6f1c23367f21bd201d9d469723e49959
parentf073917a9e7ba423643dcae0339776470b628f65 (diff)
wallet: validationinterface: only handle active chain notifications
-rw-r--r--src/wallet/wallet.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index c840c2ee1f..7b85cc36c4 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -631,7 +631,7 @@ void CWallet::chainStateFlushed(ChainstateRole role, const CBlockLocator& loc)
{
// Don't update the best block until the chain is attached so that in case of a shutdown,
// the rescan will be restarted at next startup.
- if (m_attaching_chain) {
+ if (m_attaching_chain || role == ChainstateRole::BACKGROUND) {
return;
}
WalletBatch batch(GetDatabase());
@@ -1465,6 +1465,9 @@ void CWallet::transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRe
void CWallet::blockConnected(ChainstateRole role, const interfaces::BlockInfo& block)
{
+ if (role == ChainstateRole::BACKGROUND) {
+ return;
+ }
assert(block.data);
LOCK(cs_wallet);