From: gg Date: Mon, 19 Jan 2026 21:55:29 +0000 (-0500) Subject: Fix: Ensure History/UI updates during background mempool scan X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=61ed8937d50645c134acff0e97a6f4fd6c0174ca;p=gamesguru%2Ffeather.git Fix: Ensure History/UI updates during background mempool scan --- diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 19286869..d3b00d1b 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -1764,14 +1764,14 @@ void Wallet::scanMempool() { try { std::vector> process_txs; m_wallet2->update_pool_state(process_txs, false, false); - if (!process_txs.empty()) { - m_wallet2->process_pool_state(process_txs); - } - // Refresh models so the UI picks up the new transaction(s) - if (m_history) m_history->refresh(); - if (m_coins) m_coins->refresh(); - if (m_subaddress) m_subaddress->refresh(); + // We invoke this on the main thread to ensure signals (beginResetModel) are processed synchronously + // with the data update, preventing race conditions or ignored updates in the view. + QMetaObject::invokeMethod(this, [this]{ + if (m_history) m_history->refresh(); + if (m_coins) m_coins->refresh(); + if (m_subaddress) m_subaddress->refresh(); + }, Qt::QueuedConnection); emit updated(); } catch (const std::exception &e) {