Can a transaction be in two blocks?

2

What happens with a valid block which contains a transaction which was already included in previous blocks? Is such a block accepted by other nodes in the network or discarded?

dijxtra

Posted 2013-12-13T08:46:29.060

Reputation: 145

Answers

2

The second time the transaction appears in a block the outputs it claims are already marked as claimed, hence the transaction, seen a second time, would be invalid. By definition the block is only valid if all transactions in it are valid.

The only way of a transaction landing in two potentially valid blocks is during a blockchain fork, where the two competing blockchain heads both include the transaction.

If a miner were to include an already confirmed transaction it would invalidate the block, and he would lose its reward. Notice that this also avoids having a miner claim fees multiple times, which would effectively create new coins from thin air.

cdecker

Posted 2013-12-13T08:46:29.060

Reputation: 7 878