-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing balance at restore from seed words #2517
Fix missing balance at restore from seed words #2517
Conversation
We subtract 1 day to be sure to not have any issues with timezones. Even if we can be sure that the timezone is handled correctly it could be that the user created the wallet in one timezone and make a restore at a different timezone which could lead in the worst case that he miss the first day of the wallet transactions.
Fixes #2516 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Verified that the balance was correct and addresses were restored.
// but can help as well in case the addressEntry list would miss an address where the wallet was received | ||
// funds (e.g. if the user sends funds to an address which has not been provided in the main UI - like from the | ||
// wallet details window). | ||
wallet.addTransactionConfidenceEventListener((w, tx) -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TransactionConfidenceEventListener does the job but it seems to be an overkill. TransactionConfidenceEventListener is invoked for each wallet tx every time its "confidence" is updated (eg, when included in a block and every time a new block is mined on top of that block for the next 100 blocks).
Probably you want to use WalletCoinsReceivedEventListener and WalletCoinsSentEventListener (and ScriptsChangeEventListener if you use the watched script feature of Wallet) instead to be notified of new addresses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the WalletCoinsReceivedEventListener and WalletCoinsSentEventListener (both combined) but the balance was not correct that way. I have not investigated further why, but if you could find out would be good. I am aware that the TransactionConfidenceEventListener is a bit heavy.
If you test it you need a wallet which is a bit older and has a few addresses where it has send/received. During the spv chain sync you can check if the UI balance is the same as the one from the wallet shown at the popup opened from cmd+e.
No description provided.