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

client/asset/dcr: restart required after restoring native dcr wallet with funds #1816

Closed
chappjc opened this issue Aug 23, 2022 · 3 comments · Fixed by #1955
Closed

client/asset/dcr: restart required after restoring native dcr wallet with funds #1816

chappjc opened this issue Aug 23, 2022 · 3 comments · Fixed by #1955
Labels
bug bug or bugfix wallet Client wallet backends

Comments

@chappjc
Copy link
Member

chappjc commented Aug 23, 2022

When I reinitialized dexc with a native DCR wallet that had funds, it showed 0 balance even after scan/recover had completed. I had to restart dexc to have the proper balance.

Refreshing the UI did not help.
New DCR blocks did not change the balance either. a new block seems to trigger the proper balance.

@chappjc
Copy link
Member Author

chappjc commented Aug 24, 2022

A related issue is that sync status for the native DCR wallet seems to neglect the wallet rescan that comes after block header and filter sync. This is not really noticeable on simnet, but it's major on testnet and mainnet. That is, when you create the wallet it will get to 100% synced at this point:

2022-08-24 09:31:42.154 [INF] SPV: Connected 2000 blocks, new tip 000000001477f201395d9fdbdbf08b4576235f17ef8dbe3dd0c0fee47385f33c, height 974000, date 2022-08-20 06:27:58 -0500 CDT
2022-08-24 09:31:42.438 [DBG] SPV: Fetched 2000 new header(s) ending at height 976000 from [2001:19f0:5:33c5:5400:2ff:fee0:b1c3]:19108
2022-08-24 09:31:42.706 [INF] SPV: Connected 2000 blocks, new tip 00000000208e62d3981c876c06f8983b8e3cc4ff528d13eac2b83bd5e7110660, height 976000, date 2022-08-23 02:55:29 -0500 CDT
2022-08-24 09:31:42.921 [DBG] SPV: Fetched 952 new header(s) ending at height 976952 from [2001:19f0:5:33c5:5400:2ff:fee0:b1c3]:19108
2022-08-24 09:31:43.046 [INF] SPV: Connected 952 blocks, new tip 00000000ba45d21fdc8eea2e3c40977545304887973e6ac3d9c8476e8adc50eb, height 976952, date 2022-08-24 09:30:09 -0500 CDT

However, this is where its rescan/recover starts:

2022-08-24 09:31:43.046 [INF] SPV: Connected 952 blocks, new tip 00000000ba45d21fdc8eea2e3c40977545304887973e6ac3d9c8476e8adc50eb, height 976952, date 2022-08-24 09:30:09 -0500 CDT
2022-08-24 09:31:43.102 [INF] WLLT: Discovering used addresses for 1 account(s)
2022-08-24 09:32:12.445 [INF] WLLT: Account 0 next child indexes: external:2 internal:1
2022-08-24 09:32:12.445 [INF] WLLT: Updating DB with discovered addresses...
2022-08-24 09:32:12.461 [INF] WLLT: Finished address discovery
2022-08-24 09:32:12.461 [INF] WLLT: Loading active addresses and unspent outputs...
2022-08-24 09:32:12.472 [INF] WLLT: Registered for transaction notifications for 203 HD address(es)
2022-08-24 09:32:12.472 [INF] WLLT: Registered for transaction notifications for all relevant outputs
2022-08-24 09:32:12.473 [INF] WLLT: Rescanning block range [1, 2000]...
2022-08-24 09:32:12.540 [INF] WLLT: Rescanning block range [2001, 4000]...
...
2022-08-24 09:32:48.052 [INF] WLLT: Rescanning block range [974001, 976000]...
2022-08-24 09:32:48.062 [INF] WLLT: Rescanning block range [976001, 976953]...
2022-08-24 09:32:48.124 [INF] WLLT: Rescan complete

Only then is it really synchronized. Not sure if we have visibility to this rescanning state.

And then the next block the balance actually updates.

@vctt94
Copy link
Member

vctt94 commented Aug 24, 2022

Taking a look on it. Does it also happen with btc wallets?

@buck54321 buck54321 added bug bug or bugfix client wallet Client wallet backends labels Sep 15, 2022
@vctt94
Copy link
Member

vctt94 commented Sep 21, 2022

So looking into it, it looks like the reason is dcrwallet v1.7.4 does not update the balance after restoring a spv wallet.

For me new blocks does not seem to update the balance, but locking and unlocking the wallet does update.

How should we dealt with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug or bugfix wallet Client wallet backends
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants