<p>When a node hears about a new transaction, they try to accept it to their in-memory pool of transactions. If a node hears about a transaction that conflicts with one of the transactions that is already in their mem-pool, then they simply won't accept it to their mem-pool. The default client also won't forward the transaction on to any other nodes, either. </p>

<blockquote>
  <p>The node drops the two transactions? The node choose one to keep?</p>
</blockquote>

<p>So, essentially, if a node sees a double spend (two transactions trying to spend the same output) they keep the transaction that they saw first.</p>

<blockquote>
  <p>Both transactions will be rejected by the network or one of them will be eventually accepted?</p>
</blockquote>

<p>Assuming they pay the standard fee to get confirmed, a miner would likely include whichever transaction they saw first. So, if more miners see one transaction, it is more likely that one will get confirmed. It's possible miners will solve two blocks at the same time, with conflicting spends of a previous output. In the long run, though, only one spend of an output will stay in the main chain.</p>

CC BY-SA 3.0
2015-01-09T19:04:13.363Z
2015-01-09T19:32:32.557Z
2015-01-09T19:32:32.557Z
morsecoder
<p>Does the node drop both transactions? Does the node choose which one to keep? What exactly happens? Will both transactions be rejected by the network or will one of them be eventually accepted?</p>

CC BY-SA 3.0
2015-01-09T19:33:10.440Z
related: [How secure is zero confirmations?](http://bitcoin.stackexchange.com/q/20845/5406)
Murch
<doublespend>
What exactly happens when a node detects a double spend?
Felipe
# What exactly happens when a node detects a double spend?

(Asked by: username_0 on 2015-01-09)

Does the node drop both transactions? Does the node choose which one to keep? What exactly happens? Will both transactions be rejected by the network or will one of them be eventually accepted?

**Tags:** doublespend

> **Comments:**
> **username_1**: related: [How secure is zero confirmations?](http://bitcoin.stackexchange.com/q/20845/5406)  

---

## 1 answers

### Answer by username_2 on 2015-01-09. Score: 6 | Accepted answer

When a node hears about a new transaction, they try to accept it to their in-memory pool of transactions. If a node hears about a transaction that conflicts with one of the transactions that is already in their mem-pool, then they simply won't accept it to their mem-pool. The default client also won't forward the transaction on to any other nodes, either.

> The node drops the two transactions? The node choose one to keep?

So, essentially, if a node sees a double spend (two transactions trying to spend the same output) they keep the transaction that they saw first.

> Both transactions will be rejected by the network or one of them will be eventually accepted?

Assuming they pay the standard fee to get confirmed, a miner would likely include whichever transaction they saw first. So, if more miners see one transaction, it is more likely that one will get confirmed. It's possible miners will solve two blocks at the same time, with conflicting spends of a previous output. In the long run, though, only one spend of an output will stay in the main chain.


---

