As I understand it, a transaction basically consists of a from address
, to address
, amount
and some component that verifies that the owner of the from_address
has requested the transaction. A transaction is broadcast to the network in the hope that it will get included into a freshly mined block.
If the miner can choose which transactions to add to a block. How does the Bitcoin protocol stop a miner from re-adding an existing transaction to the chain? and thus recreating the transaction and doubling the effect of the transaction.
Surely it is not feasible to search the entire transaction history to make sure the transaction hasn't already been included.
EDIT - from a bit of further research, it looks like including a confirmed transaction will render a block invalid and it will be rejected by other Bitcoin nodes. But how can you determine if the block contained an already confirmed transaction in an efficient way?