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_);
    WaetBatch batch(GetDatabase(), fFlushOnClose);
    uint256 hash = tx->GetHash();
    if (IsWaetFlagSet(WALLET_FLAG_AVOID_REUSE)) {
        // M
        std::set<CTxDestination> tx_destinations;
        for (const CTxIn& txin : tx->vin) {
            const COutPoint& op = txin.prevout;
            SetSKeyState(batch, op.hash, op.n, true, tx_destinations);
        }
        MarkDestinationsDirty(tx_destinations);
    }
    // I
    auto ret = mapWaet.emplace(std::piecewise_construct, std::forward_as_tuple(hash), std::forward_as_tuple(tx, state));
    CWaetTx& wtx = (*ret.first).second;
    bool fInsertedNew = ret.second;
    bool fUpdated = update_wtx && update_wtx(wtx, fInsertedNew);
    if (fInsertedNew) {
        wtx.nTimeReceived = GetTime();
        wtx.nOrderPos = IncOrderPosNext(&batch);
        wtx.m_it_wtxOrdered = wtxOrdered.insert(std::make_pair(wtx.nOrderPos, &wtx));
        wtx.nTimeSmart = ComputeTimeSmart(wtx, rescanning_old_block);
        AddToSpends(wtx, &batch);
    }
    if (!fInsertedNew)
    {
        if (state.index() != wtx.m_state.index()) {
            wtx.m_state = state;