How does Bitcoin prevent replay-attacks for P2PKH transactions?
As far as I understand, when a transaction is made to pay bitcoins to another account, the P2PKH script is used.
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG scriptSig: <sig> <pubKey>
Now, even though I may not know what the private key of the person who sends the scriptSig is, I still know how a valid signature from him looks for this very transaction.
So, if I simply copy the transaction with the same data, the check for the signature should still be all valid. So, if someone pays me coins, what prevents me sending the same transaction over and over again, effectively draining all his coins?