https://cirrus-ci.com/task/5603470202896384?logs=ci#L2681
// user could call sendmoney in a loop and hit spurious out of funds errors
    // because we think that this newly generated transaction's change is
    // unavailable as we're not yet aware that it is in the mempool.
    //
    //  broadcast fails for any reason, trying to set wtx.m_state here would be incorrect.
    //  transaction was previously in the mempool, it should be updated when
    // TransactionRemovedFromMempool fires.
    bool ret = chain().broadcastTransaction(wtx.tx, m_default_max_tx_fee, relay, err_string);
    if (ret) wtx.m_state = TxStateInMempool{};
    return ret;
}
stdset<uint256> CWalletGetTxConflicts(const CWalletTx& wtx) const
{
    AssertLockHeld(cs_);
    const uint256 myHash{wtx.GetHash()};
    stdset<uint256> result{GetConflicts(myHash)};
    result.erase(myHash);
    return result;
}
// Resubmit transactions from th to the mempool, optionally asking the
// mempool to relay them. On startup, we will do this for all unconfirmed
// transactions but will not ask the mempool to relay them. We do this on startup
// to ensure that our own mempool is aware of our transactions, and to also
// initialize nNextResend so that the actual rebroadcast is scheduled. There
// is a privacy side effect here as not broadcasting on startup also means that we won't
// inform the world of our 's state, particularly if th (or node) is not
// yet synced.
//
// Otheise this function is called periodically in order to relay our unconfirmed txs.
// We do this on a random timer to slightly obfuscate which transactions