|
May 23, 2010, 04:57:35 AM |
|
OK, so I've been doing a little testing with double spending, and while I'm prevented from spending the same coins twice, I do see a potential problem: Lack of feedback to the second spender. The second transaction never gets into a block, but the second spender doesn't seem in my testing to see any transactions that conflict with his view of his personal transaction history, even if they have made it into many blocks. This could cause problems even if no fraud was being attempted: In the case of a hard drive failure, and a restore from backup.
Let's say I have 5000 bitcoins, and I make a backup of my bitcoin data directory. Then I spend 2000 of them, and before I back my directory up again, my hard drive fails. I restore from my previous backup, and expect that when I get the new blocks, my transactions for spending the 2000 will be in them. The problem is, my client seems to ignore those transactions, and even after my client catches up I still think I have 5000 bit coins.
I'm not sure that the right thing to do is in this case is to always accept the transactions, but it seems we should at least notify the user that something seems wrong if we see a conflicting transaction that's made it into a significantly long chain. I think the user should also be able to choose to accept the transactions to prevent attempting to double-spend already spent coins in the above scenario.
|