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 
{
    CMutableTransaction tx;
    TxState state = TxStateInactive{};
    tx.nLockTime = lockTime;
    SetMockTime(mockTime);
    CBlockIndex* block = nullptr;
    if (blockTime > 0) {
        LOCK(cs_main);
        auto inserted = chainman.BlockIndex().emplace(std::piecewise_construct, std::make_tuple(GetRandHash()), std::make_tuple());
        assert(inserted.second);
        const uint256& hash = inserted.first->first;
        block = &inserted.first->second;
        block->nTime = blockTime;
        block->phashBlock = &hash;
        state = TxStateConfirmed{hash, block->nHeight, 0};
    }
    return wallet.AddToWallet(MakeTransactionRef(tx), state, [&](CWalletTx& wtx, bool ) {
        
        
        
        wtx.m_state = state;
        return true;
    })->nTimeSmart;
}
BOOST_AUTO_TEST_CASE(ComputeTimeSmart)