<p>Firstly, there is no &quot;the mempool&quot;. There is no global mempool. Rather each node maintains its own mempool and accepts and rejects transaction to that mempool using their own internal policies. Most nodes have the same policies, but due to different start times, relay delays, and other factors, not every node has the same mempool, although they may be very similar.</p>
<p>When it comes to doublespends, the typical node policy is that if a transaction conflicts with another transaction, it will not be accepted by that node, thus the conflicting transaction doesn't enter that node's mempool. So unless you modify your node to accept conflicts, your node's mempool will never contain conflicting transactions.</p>

CC BY-SA 4.0
2020-08-17T16:09:00.137Z
Thanks for the answer. My question is exactly here that how to detect that two transactions are double spends and delete them. I mean the algorithm behind that. What I am curious to know is identifying double spends and the algorithmics behind it. Given two transactions as conflicting transactions, they both have at least one common input transaction. However, what else should we check to find if two transactions are conflicting and double spend?
Ali Shakiba
CC BY-SA 4.0
2020-08-17T16:18:40.230Z
That's all that you have to check. Two different transactions (different txids) that have at least one identical input (same txid and vout in one input).
Ava Chow
CC BY-SA 4.0
2020-08-17T15:43:30.420Z
2020-08-17T15:43:30.420Z
Ava Chow
<p>There are lots of transactions over the mempool of the bitoin. However, there might be double spends. How can we verify whether two transactions are conflicting, i.e. they are double spends of a bitcoin?</p>
<p>P.S. Given two transactions are conflicting, then they both have at least one common input transactions. So, what else should be checked to verify that two transactions are conflicting (double spend).</p>
<p>Thanks</p>

<doublespend>
How to find if two transactions in mempool are conflicting?
Ali Shakiba
# How to find if two transactions in mempool are conflicting?

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

There are lots of transactions over the mempool of the bitoin. However, there might be double spends. How can we verify whether two transactions are conflicting, i.e. they are double spends of a bitcoin?

P.S. Given two transactions are conflicting, then they both have at least one common input transactions. So, what else should be checked to verify that two transactions are conflicting (double spend).

Thanks

**Tags:** doublespend


---

## 1 answers

### Answer by username_1 on 2020-08-17. Score: 2 | Accepted answer

Firstly, there is no "the mempool". There is no global mempool. Rather each node maintains its own mempool and accepts and rejects transaction to that mempool using their own internal policies. Most nodes have the same policies, but due to different start times, relay delays, and other factors, not every node has the same mempool, although they may be very similar.

When it comes to doublespends, the typical node policy is that if a transaction conflicts with another transaction, it will not be accepted by that node, thus the conflicting transaction doesn't enter that node's mempool. So unless you modify your node to accept conflicts, your node's mempool will never contain conflicting transactions.

> **Comments:**
> **username_0**: Thanks for the answer. My question is exactly here that how to detect that two transactions are double spends and delete them. I mean the algorithm behind that. What I am curious to know is identifying double spends and the algorithmics behind it. Given two transactions as conflicting transactions, they both have at least one common input transaction. However, what else should we check to find if two transactions are conflicting and double spend?  
> **username_1**: That's all that you have to check. Two different transactions (different txids) that have at least one identical input (same txid and vout in one input).  

---

