Bitcoin Forum
April 01, 2020, 02:59:29 AM *
News: The virus is now s̴͜͠p̶̰͝r̷̰̅e̶̦̽a̵̼͂d̴͉̑ỉ̷̖n̸̙̏g̷̬͝ even online; practice social distancing!
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What if you spend after receiving a double spend?  (Read 1237 times)
Hal
VIP
Sr. Member
*
expert
Offline Offline

Activity: 314
Merit: 995



View Profile
January 28, 2011, 09:41:15 PM
 #1

Suppose you receive a payment and then immediately spend it. Then there is a block reorganization and the payment to you goes away. It never comes back because it was a double spend. Can the client handle this? How would it appear in the transaction window?

Hal Finney
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
caveden
Legendary
*
Offline Offline

Activity: 1106
Merit: 1002



View Profile
January 29, 2011, 11:58:54 AM
 #2

What's interesting is to ask what happens if in the inputs you have addresses that are "fine" and others which have their balance dependent on the double-spend. What happens to this transactions after the block reorganization?
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1008


View Profile
January 29, 2011, 12:30:22 PM
 #3

I think the transactions in question will go back to showing as zero confirmations.
Cdecker
Hero Member
*****
Offline Offline

Activity: 490
Merit: 503



View Profile WWW
January 30, 2011, 11:41:27 AM
 #4

I think the transactions in question will go back to showing as zero confirmations.
Exactly, it'll return to 0 and never confirm Cheesy
Btw: all transactions could be invalidated, it's just incredibly unlikely, because someone would have to fork the chain before the transaction and overtake the current chain.

Want to see what developers are chatting about? http://bitcoinstats.com/irc/bitcoin-dev/logs/
Bitcoin-OTC Rating
theymos
Administrator
Legendary
*
Offline Offline

Activity: 3710
Merit: 7650


View Profile
January 30, 2011, 12:15:18 PM
 #5

What's interesting is to ask what happens if in the inputs you have addresses that are "fine" and others which have their balance dependent on the double-spend.

The good inputs will end up getting stuck. There was an "outbreak" of a similar issue a while ago when Bitcoin sent 0-confirmation coins that would never confirm, permanently tying up all of the other coins in that transaction. Bitcoin now never sends 0-confirmation coins and prefers to send fully-confirmed coins, so this sort of thing should be less likely.

ReacceptWalletTransactions() already re-checks your transactions on Bitcoin startup, but it doesn't seem to remove the transactions if they've become invalid. Maybe it should do so for sent transactions.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!