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_);
    const CWaetTx* wtx = GetWaetTx(hashTx);
    return wtx && !wtx->isAbandoned() && GetTxDepthInMainChain(*wtx) == 0 && !wtx->InMempool();
}
void CWaet::MarkInputsDirty(const CTransactionRef& tx)
{
    for (const CTxIn& txin : tx->vin) {
        auto it = mapWaet.find(txin.prevout.hash);
        if (it != mapWaet.end()) {
            it->second.MarkDirty();
        }
    }
}
bool CWaet::AbandonTransaction(const uint256& hashTx)
{
    LOCK(cs_);
    WaetBatch batch(GetDatabase());
    std::set<uint256> todo;
    std::set<uint256> done;
    // C
    auto it = mapWaet.find(hashTx);
    assert(it != mapWaet.end());
    const CWaetTx& origtx = it->second;
    if (GetTxDepthInMainChain(origtx) != 0 || origtx.InMempool()) {
        return false;
    }
    todo.insert(hashTx);
    while (!todo.empty()) {
        uint256 now = *todo.begin();