saifi009 / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
0 stars 0 forks source link

Transaction.getValueSentFromMe() bug & fix #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Playing around with bitcoinj I found a bug with the PingService.
For some reason it stopped returning coins, and it turned out that the cause 
was that WalletEventListener.onCoinsReceived() was not always called when coins 
are received. 
In some cases the valueDifference in Wallet.receive() gets negative when the 
wallet receives coins. This is because a bug in 
Transaction.getValueSentFromMe(). 

The problem is that a connected output in a transaction may point at the change 
to the sender of a previous input sent to the wallet. The fix is simple, patch 
attached. 

The wallet balance however turns up right, because the balance calculation is 
not based on valueSentFromMe.

Original issue reported on code.google.com by jan.mol...@gmail.com on 2 Jul 2011 at 6:48

Attachments:

GoogleCodeExporter commented 9 years ago
I'd say this is a dup of issue 28.
I tested your patch and it seems to help a lot regarding my issue with lost 
change.
However, after some more testing I ran into issue 36. Don't know if this is 
related or not.

Original comment by andreas....@gmail.com on 2 Jul 2011 at 7:41

GoogleCodeExporter commented 9 years ago
Whoops, thanks for the patch. Could you sign the CLA? I'll check this in next 
week along with a unit test covering the bug.

Original comment by hearn@google.com on 2 Jul 2011 at 9:36

GoogleCodeExporter commented 9 years ago
Sure thing. How/where do i find the CCL?

Original comment by jan.mol...@gmail.com on 2 Jul 2011 at 2:09

GoogleCodeExporter commented 9 years ago
erhm.. CLA

Original comment by jan.mol...@gmail.com on 2 Jul 2011 at 2:45

GoogleCodeExporter commented 9 years ago
Here it is:

http://code.google.com/legal/individual-cla-v1.0.html

Original comment by hearn@google.com on 4 Jul 2011 at 7:53

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r124. Thanks for the fix!

Original comment by hearn@google.com on 6 Jul 2011 at 12:14