novitski / bitcoinj

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

Removing spent transactions seem to modify value of other transactions #388

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have one user reporting that his tx 
3b2751483b8e902b289265a576321d72c2b693dd0a85c9ffeb53c2ee963279b7 shows the 
correct value 0.0055 after a blockchain replay, but it changes its value to 
0.00209815 after some time.

I'm attaching two wallet dumps. One after the replay (1252...). Another one 
after the value has changed (3756...). As you can see, spent transactions have 
been evicted between those two dumps, so this issue is most likely a side 
effect of wallet eviction. But why is this influencing the value of the tx in 
question? I suspect bitcoinj has moved a tx too early into spent or something 
like that.

Original issue reported on code.google.com by andreas....@gmail.com on 13 Apr 2013 at 11:36

Attachments:

GoogleCodeExporter commented 9 years ago
I should add that overall wallet balance seems to be unaffected by this issue.

Original comment by andreas....@gmail.com on 13 Apr 2013 at 11:37

GoogleCodeExporter commented 9 years ago
That is expected. The "value" of a transaction (which is somewhat arbitrary) is 
the difference of value sent to me vs sent from me. However if transactions are 
deleted from the wallet, it no longer knows that some of the value of that tx 
came from itself so the calculate value will change.

Fixing it means recording in the wallet the fact that an input of a tx was 
linked to an output in the past but the transaction got deleted, and keeping 
around the value it had.

Original comment by hearn@google.com on 13 Apr 2013 at 8:15