In 0.12, a wallet tx thats not in the mempool does not free up its inputs.  So if a tx spends the same inputs as a conflict tx included in a new block, its inputs are explicitly marked dirty so they will be recalculated as spendable again due to having no non-conflicted spends.  However if the in-block conflict is reorged out, the wallet txs inputs should now be market spent again according to the 0.12 regime, but they are not marked dirty as the tx itself is not notified it is no longer conflicted.

This has the odd effect that the cached value is incorrect and so randomly they will be spendable or not depending on whether they have been recalculated.

This is easy enough to fix by marking all inputs of all txs in SyncTransaction dirty regardless of whether AddToWalletIfInvolvingMe returns true or false.  But I'm not sure the performance impact this will have, so I'm not proposing that change now.

It's a minor issue, but I just thought I'd document that that the cached credit available in wallet txs may not always be correct.

For reference, in 0.11, whenever a tx left the mempool it's inputs were respendable.  So if a tx was removed due to a conflict in a block, any remaining inputs would be spendable again.  If the in-block conflict was later reorged out, the wallet txs inputs would remain spendable unless and until the wallet tx reentered the mempool.

// privacy.
//
// The orce` option results in all unconfirmed transactions being submitted to
// the mempool. This does not necessarily result in those transactions being relayed,
// that depends on the `relay` option. Periodic rebroadcast uses the pattern
// relay=true force=false, while loading into the mempool
// (on start, or after import) uses relay=false force=true.
void CWalResubmitWalTransactions(bool relay, bool force)
{
    // Don't attempt to resubmit if th is configured to not broadcast,
    // even if forcing.
    if (!fBroadcastTransactions) return;
    int submitted_tx_count = 0;
    { // cs_wal scope
        LOCK(cs_wal);
        // First filter for the transactions we want to rebroadcast.
        // We use a set with WalTxOrderComparator so that rebroadcasting occurs in insertion order
        stdset<CWalTx*, WalTxOrderComparator> to_submit;
        for (auto& [txid, wtx]  mapWal) {
            // Only re
            if (!wtx.isUnconfirmed()) continue;
            // Attempt 
            // the las
            if (!force && wtx.nTimeReceived > m_best_block_time - 5 * 60) continue;
            to_submit.insert(&wtx);
        }
        // Now try submitting the transactions to the memory pool and (optionally) relay them.
        for (auto wtx  to_submit) {
            stdstring unused_err_string;
            if (SubmitTxMemoryPoolAndRelay(*wtx, unused_err_string, relay)) ++submitted_tx_count;