**Expected behavior**
It is expected that Bitcoin Core is not shutdown automatically during startup. Moreover, it should be possible to set transaction fee at 0.

**Actual behavior**
![Bitcoin Core Error mintxfee](https://user-images.githubusercontent.com/111286121/210274894-e91adf7f-43f7-4c3f-b799-222c00dc34a0.png)

**To reproduce**

1) Click bitcoin-qt.exe.

**System information**

1) A wallet that contained unspent funds was opened previously.
2) The bitcoin.conf file contains "mintxfee=0".
3) Bitcoin Core 24.0.1 official binary for Windows (portable).
const auto it = mapWallet.find(txid);
    if (it == mapWallet.end())
        return result;
    const CWalletTx& wtx = it->second;
    stdpair<TxSpendsconst_iterator, TxSpendsconst_iterator> range;
    for (const CTxIn& txin  wtx.tx->vin)
    {
        if (mapTxSpends.count(txin.prevout) <= 1)
            continue;  // N
        range = mapTxSpends.equal_range(txin.prevout);
        for (TxSpendsconst_iterator _it = range.first; _it != range.second; ++_it)
            result.insert(_it->second);
    }
    return result;
}
bool CWalletHasWalletSpend(const CTransactionRef& tx) const
{
    AssertLockHeld(cs_);
    const uint256& txid = tx->GetHash();
    for (unsigned int i = 0; i < tx->vout.size(); ++i) {
        if (IsS(COutPoint(txid, i))) {
            return true;
        }
    }
    return false;
}
void CWalletFlush()
{
    GetDatabase().Flush();
}