<p>This error means that you're trying to spend the same transaction output more than once.</p>

<p>More specifically, when you submit a transaction, a check is done (on the node) against the previous outputs of your new transaction to see if they are already trying to be spent by a transaction in the memory pool.</p>

<p>The check is in <code>validation.cpp</code> in the bitcoin source:</p>

<pre><code>// Check for conflicts with in-memory transactions
std::set&lt;uint256&gt; setConflicts;
for (const CTxIn &amp;txin : tx.vin)
{
    auto itConflicting = pool.mapNextTx.find(txin.prevout);
    if (itConflicting != pool.mapNextTx.end())
    {
        const CTransaction *ptxConflicting = itConflicting-&gt;second;
        if (!setConflicts.count(ptxConflicting-&gt;GetHash()))
        {
            // Allow opt-out of transaction replacement by setting
            // nSequence &gt; MAX_BIP125_RBF_SEQUENCE (SEQUENCE_FINAL-2) on all inputs.
            //
            // SEQUENCE_FINAL-1 is picked to still allow use of nLockTime by
            // non-replaceable transactions. All inputs rather than just one
            // is for the sake of multi-party protocols, where we don't
            // want a single party to be able to disable replacement.
            //
            // The opt-out ignores descendants as anyone relying on
            // first-seen mempool behavior should be checking all
            // unconfirmed ancestors anyway; doing otherwise is hopelessly
            // insecure.
            bool fReplacementOptOut = true;
            if (fEnableReplacement)
            {
                for (const CTxIn &amp;_txin : ptxConflicting-&gt;vin)
                {
                    if (_txin.nSequence &lt;= MAX_BIP125_RBF_SEQUENCE)
                    {
                        fReplacementOptOut = false;
                        break;
                    }
                }
            }
            if (fReplacementOptOut) {
                return state.Invalid(false, REJECT_DUPLICATE, "txn-mempool-conflict");
            }

            setConflicts.insert(ptxConflicting-&gt;GetHash());
        }
    }
}
</code></pre>

CC BY-SA 4.0
2018-07-26T16:12:18.813Z
2018-07-26T16:12:18.813Z
JBaczuk
<p>I am getting this error message. What does it mean?
Validation Error: Error #-26: 258: txn-mempool-conflict</p>

<bitcoin-core>
Validation Error: Error #-26: 258: txn-mempool-conflict
Bunmi Ayeni
# Validation Error: Error #-26: 258: txn-mempool-conflict

(Asked by: username_0 on 2017-08-17)

I am getting this error message. What does it mean?
Validation Error: Error #-26: 258: txn-mempool-conflict

**Tags:** bitcoin-core


---

## 1 answers

### Answer by username_1 on 2018-07-26. Score: 2

This error means that you're trying to spend the same transaction output more than once.

More specifically, when you submit a transaction, a check is done (on the node) against the previous outputs of your new transaction to see if they are already trying to be spent by a transaction in the memory pool.

The check is in `validation.cpp` in the bitcoin source:

```
// Check for conflicts with in-memory transactions
std::set<uint256> setConflicts;
for (const CTxIn &txin : tx.vin)
{
    auto itConflicting = pool.mapNextTx.find(txin.prevout);
    if (itConflicting != pool.mapNextTx.end())
    {
        const CTransaction *ptxConflicting = itConflicting->second;
        if (!setConflicts.count(ptxConflicting->GetHash()))
        {
            // Allow opt-out of transaction replacement by setting
            // nSequence > MAX_BIP125_RBF_SEQUENCE (SEQUENCE_FINAL-2) on all inputs.
            //
            // SEQUENCE_FINAL-1 is picked to still allow use of nLockTime by
            // non-replaceable transactions. All inputs rather than just one
            // is for the sake of multi-party protocols, where we don't
            // want a single party to be able to disable replacement.
            //
            // The opt-out ignores descendants as anyone relying on
            // first-seen mempool behavior should be checking all
            // unconfirmed ancestors anyway; doing otherwise is hopelessly
            // insecure.
            bool fReplacementOptOut = true;
            if (fEnableReplacement)
            {
                for (const CTxIn &_txin : ptxConflicting->vin)
                {
                    if (_txin.nSequence <= MAX_BIP125_RBF_SEQUENCE)
                    {
                        fReplacementOptOut = false;
                        break;
                    }
                }
            }
            if (fReplacementOptOut) {
                return state.Invalid(false, REJECT_DUPLICATE, "txn-mempool-conflict");
            }

            setConflicts.insert(ptxConflicting->GetHash());
        }
    }
}

```


---

