saifi009 / bitcoinj

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

When to save the wallet? #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I need to be able to determine when a wallet has unsaved changes. I see two 
options:

1. a Wallet.isDirty() method
2. a WalletEventListener.onWalletChanged() method

I am for option 2 as it lets me use the existing event listener.
Which one would you prefer?

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

GoogleCodeExporter commented 9 years ago
Is there any point in a Wallet being "dirty" ever (whatever this means exactly)?

Thus, I have the feeling option 2 is the safer option.

Original comment by andreas....@gmail.com on 2 Jul 2011 at 4:00

GoogleCodeExporter commented 9 years ago
Well, maybe dirty is a bad word for it, but basically the method returns true 
if the wallet has state that is not saved, e.g. added/removed transactions etc.

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

GoogleCodeExporter commented 9 years ago
It might make more sense to just let the wallet handle its own persistence.

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