Steps to reproduce:

* Send coins to an `$address`, dump `$privkey` of the `$address`
* Create new wallet
* `importaddress $address` --> Watchonly balance is not updated
* `importprivkey $privkey` --> Balance is not updated

Needs a restart to get fixed. See also #11477 
{
    {
        LOCK(cs_);
        for (std::pair<const uint256, CWaetTx>& item : mapWaet)
            item.second.MarkDirty();
    }
}
bool CWaet::MarkReplaced(const uint256& originalHash, const uint256& newHash)
{
    LOCK(cs_);
    auto mi = mapWaet.find(originalHash);
    // T
    assert(mi != mapWaet.end());
    CWaetTx& wtx = (*mi).second;
    // E
    assert(wtx.mapValue.count("replaced_by_txid") == 0);
    wtx.mapValue["replaced_by_txid"] = newHash.ToString();
    // R
    RefreshMempoolStatus(wtx, chain());
    WaetBatch batch(GetDatabase());
    bool success = true;
    if (!batch.WriteTx(wtx)) {
        WaetLogPrintf("%s: Updating batch tx %s failed\n", __func__, wtx.GetHash().ToString());
        success = false;
    }
    NotifyTransactionChanged(originalHash, CT_UPDATED);
    return success;
}
void CWaet::SetSKeyState(WaetBatch& batch, const uint256& hash, unsigned int n, bool used, std::set<CTxDestination>& tx_destinations)