diff --git a/src/app_network.cpp b/src/app_network.cpp index a7689dc..6a8e408 100644 --- a/src/app_network.cpp +++ b/src/app_network.cpp @@ -2070,6 +2070,20 @@ void App::setMiningAddress(const std::string& addr, bool mining) if (settings_) { settings_->setMiningAddress(addr, mining); settings_->save(); + + // Re-label the in-memory history right away. "mined" vs "receive" is purely a function of + // whether the receiving address is flagged for mining, so flip the affected rows now: the + // History tab updates immediately, and — importantly — the next refresh's carry-over of + // not-yet-rescanned transactions then matches the fresh scan. (Without this, the refresh + // re-scans a tx as "receive" but appendMissingPreviousTransactions, which dedupes by + // txid+type, still carries the stale "mined" copy over, so the change never showed.) + const auto miningAddrs = settings_->getMiningAddresses(); + for (auto& tx : state_.transactions) { + if ((tx.type == "receive" || tx.type == "mined") && !tx.address.empty()) { + tx.type = miningAddrs.count(tx.address) ? "mined" : "receive"; + } + } + invalidateShieldedHistoryScanProgress(true); transactions_dirty_ = true; last_tx_block_height_ = -1;