Skip to content
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

Conversation

ManfredKarrer
Copy link
Member

No description provided.

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.
@ManfredKarrer
Copy link
Member Author

Fixes #2516

Copy link
Member

@devinbileck devinbileck left a 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.

@ManfredKarrer ManfredKarrer merged commit ca01376 into bisq-network:master Mar 8, 2019
@ManfredKarrer ManfredKarrer deleted the fix-missing-balance-at-restore-from-seed-words branch March 8, 2019 17:18
// 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) -> {
Copy link
Contributor

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.

Copy link
Member Author

@ManfredKarrer ManfredKarrer Mar 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants