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 
{
    CWallet wallet(m_node.chain.get(), "", m_args, CreateDummyWalletDatabase());
    CWalletTx wtx{m_coinbase_txns.back(), TxStateConfirmed{m_node.chainman->ActiveChain().Tip()->GetBlockHash(), m_node.chainman->ActiveChain().Height(), 0}};
    LOCK(wallet.cs_wallet);
    wallet.SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
    wallet.SetupDescriptorScriptPubKeyMans();
    wallet.SetLastBlockProcessed(m_node.chainman->ActiveChain().Height(), m_node.chainman->ActiveChain().Tip()->GetBlockHash());
    
    
    BOOST_CHECK_EQUAL(CachedTxGetImmatureCredit(wallet, wtx), 0);
    
    
    wtx.MarkDirty();
    AddKey(wallet, coinbaseKey);
    BOOST_CHECK_EQUAL(CachedTxGetImmatureCredit(wallet, wtx), 50*COIN);
}
static int64_t AddTx(ChainstateManager& chainman, CWallet& wallet, uint32_t lockTime, int64_t mockTime, int64_t blockTime)