danielmcclure / bitcoinj

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

Sending payment creates fresh external address #590

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On bitcoinj 0.12.1 + some cherry picks from 0.13-SNAPSHOT. The current state is 
here: https://github.com/schildbach/bitcoinj/commits/release-0.12 (d9ef834c).

When sending a payment, it not only adds an address to the internal chain 
(expected, due to change address being used), but also an address to the 
external chain (not expected -- why should it?).

After the payment and before doing the wallet dump, the main screen is shown 
calls currentReceiveAddress() to show the QR code. This potentially can add an 
external address, but I would not expect so. If it does, it would be an 
unwanted side effect of sending payments.

I'm attaching two wallet dumps (before/after) and the log.

Original issue reported on code.google.com by andreas....@gmail.com on 8 Nov 2014 at 10:02

Attachments:

GoogleCodeExporter commented 9 years ago
I can't reproduce this on git master with wallet-template doing the send. 
Current receive address does not seem to change. I see that it's advancing in 
your wallet dumps, though I don't see any "Marking as used" line for those 
keys. Are you sure freshReceiveAddress() isn't being called anywhere? Could you 
maybe put a log line or breakpoint on it?

Original comment by mh.in.en...@gmail.com on 14 Nov 2014 at 2:43

GoogleCodeExporter commented 9 years ago
There is only two occurences of freshReceiveAddress() and one is if you press 
"request coins", the other one if you sweep a paper wallet.

Original comment by andreas....@gmail.com on 14 Nov 2014 at 2:58

GoogleCodeExporter commented 9 years ago
Omg, I'm so sorry. I totally forgot about the refund address! My code was 
fetching one no matter if it was actually a BIP70 payment...

Original comment by andreas....@gmail.com on 15 Nov 2014 at 10:19