<blockquote>
<p>is it possible that two transactions are in same block. to my knowledge, each node will validate the transaction before it place in memory pool. so next time the same transaction appears, doesn't it invalidate the second transaction????</p>
</blockquote>
<p>Yes, it is possible. The transactions that a node accepts to its mempool is completely up to the node and is not governed by consensus rules. The sane thing to do is to ensure that a transaction follows the consensus rules and some other local node policy rules before accepting it to the mempool, but that is not required. Thus if a miner is running custom software that accepts all transactions, they could produce a block which contains conflicting transactions.</p>
<p>Also, if a block contains conflicting transactions, then the block will be rejected, not the transactions. The block is then invalid, the transactions are still valid. If the transactions were first seen in the block, I think then both will be rejected.</p>
<blockquote>
<p>2)if two transactions entered the network simultaneously, but at different endpoint, by the time the next block is mined it's likely that they would have made it into the same block and thus be simultaneously rejected.</p>
<p>isn't it the same case as above???</p>
</blockquote>
<p>I believe the first scenario may be referring to two conflicting transactions which the miner includes in a block, not that the transactions were broadcast to the network. However both scenarios operate in the same manner.</p>

CC BY-SA 3.0
2017-06-22T00:36:06.997Z
2017-06-22T00:36:06.997Z
2020-06-16T11:10:03.350Z
Ava Chow
<p>Recently I have been studying on the bitcoin. while going through the double spend process, I found this link as
<a href="https://bitcoin.stackexchange.com/questions/13370/how-do-i-detect-a-double-spend">How do I detect a double-spend?</a></p>

<p>and an answer there describes different scenarios:</p>

<blockquote>
  <p>Double spending is handled like this -- if two transactions spending
  the same input(s) happen in the same block, both will be rejected. If
  one transaction makes it into a block before the other, the first one
  will be accepted and the second will be rejected. Now, if two
  transactions entered the network simultaneously, but at different
  endpoint, by the time the next block is mined it's likely that they
  would have made it into the same block and thus be simultaneously
  rejected. It's also possible that a block is mined containing one
  transaction, and all subsequent blocks containing the other
  transaction will simply be rejected. The third and least likely
  scenario is that two blocks are mined simultaneously -- each
  containing one of the competing transactions -- and this would cause a
  fork in the blockchain. However, this is the purpose of having
  confirmations, and by the time you reach 6, it's extremely likely that
  the forks have been reconciled and that one of these transactions will
  be rejected along with the rejected fork.</p>
</blockquote>

<p>however I could not grasp it.</p>

<ol>
<li><strong>if two transactions spending the same input(s) happen in the same block, both will be rejected.</strong></li>
</ol>

<p>Is it possible that two transactions are in same block? To my knowledge, each node will validate the transaction before it is placed in the memory pool. So next time the same transaction appears, doesn't it invalidate the second transaction?</p>

<ol start="2">
<li><strong>if two transactions entered the network simultaneously, but at different endpoint, by the time the next block is mined it's likely that they would have made it into the same block and thus be simultaneously rejected.</strong></li>
</ol>

<p>Isn't it the same case as above???</p>

<doublespend>
How do nodes behave in light of a doublespend?
Laxmi Kadariya
# How do nodes behave in light of a doublespend?

(Asked by: username_0 on 2017-06-22)

Recently I have been studying on the bitcoin. while going through the double spend process, I found this link as
[How do I detect a double-spend?](https://bitcoin.stackexchange.com/questions/13370/how-do-i-detect-a-double-spend)

and an answer there describes different scenarios:

> Double spending is handled like this -- if two transactions spending
> the same input(s) happen in the same block, both will be rejected. If
> one transaction makes it into a block before the other, the first one
> will be accepted and the second will be rejected. Now, if two
> transactions entered the network simultaneously, but at different
> endpoint, by the time the next block is mined it's likely that they
> would have made it into the same block and thus be simultaneously
> rejected. It's also possible that a block is mined containing one
> transaction, and all subsequent blocks containing the other
> transaction will simply be rejected. The third and least likely
> scenario is that two blocks are mined simultaneously -- each
> containing one of the competing transactions -- and this would cause a
> fork in the blockchain. However, this is the purpose of having
> confirmations, and by the time you reach 6, it's extremely likely that
> the forks have been reconciled and that one of these transactions will
> be rejected along with the rejected fork.

however I could not grasp it.

1. **if two transactions spending the same input(s) happen in the same block, both will be rejected.**

Is it possible that two transactions are in same block? To my knowledge, each node will validate the transaction before it is placed in the memory pool. So next time the same transaction appears, doesn't it invalidate the second transaction?

2. **if two transactions entered the network simultaneously, but at different endpoint, by the time the next block is mined it's likely that they would have made it into the same block and thus be simultaneously rejected.**

Isn't it the same case as above???

**Tags:** doublespend


---

## 1 answers

### Answer by username_1 on 2017-06-22. Score: 1

> is it possible that two transactions are in same block. to my knowledge, each node will validate the transaction before it place in memory pool. so next time the same transaction appears, doesn't it invalidate the second transaction????

Yes, it is possible. The transactions that a node accepts to its mempool is completely up to the node and is not governed by consensus rules. The sane thing to do is to ensure that a transaction follows the consensus rules and some other local node policy rules before accepting it to the mempool, but that is not required. Thus if a miner is running custom software that accepts all transactions, they could produce a block which contains conflicting transactions.

Also, if a block contains conflicting transactions, then the block will be rejected, not the transactions. The block is then invalid, the transactions are still valid. If the transactions were first seen in the block, I think then both will be rejected.

> 2)if two transactions entered the network simultaneously, but at different endpoint, by the time the next block is mined it's likely that they would have made it into the same block and thus be simultaneously rejected.
>
> isn't it the same case as above???

I believe the first scenario may be referring to two conflicting transactions which the miner includes in a block, not that the transactions were broadcast to the network. However both scenarios operate in the same manner.


---

