-
Notifications
You must be signed in to change notification settings - Fork 176
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
Ensure all displayed addresses are imported #1147
Conversation
(the slight changes in wallet_service and ygrunner are tiny fixes/cleanups, i saw no reason to remove them) |
I want to give a bit more background as it really wasn't easy to debug this, and so recording some points I understood might prove helpful. Importing of addresses into Core occurs: when we sync, and when we call In
But under the hood that function extracts scripts for any coins that the wallet owns, using The fix here is to just import the entire "gap" that is going to get displayed. See the comments: joinmarket-clientserver/jmclient/jmclient/wallet_utils.py Lines 515 to 523 in 693ce5e
It may seem logical to be a bit more 'paranoid': to ensure that every call to (Side note: I've realised the fidelity bond section of |
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.
Test suite is passing.
Tested against master with 2 QT, sending from one to the other.
With master, when I deposit to a new displayed address (i.e., an address that appears after one previous address has received some funds, and that therefore wasn't there since the start) the balance shown is not updated (same behavior as explained here). I wasn't able to reproduce observe the error after a restart, i.e., a restart or a refresh always fixed the balance, but I didn't try very hard.
With this PR the balance is updated ~immediately, as it should.
I think I get what you're saying. It can be very tricky in test setups - one gotcha is that, if you do multiple wallets on regtest, they are working against the same Core instance, so transactions can get processed even when an address was not imported, because the transaction is registered by Core because the other wallet had an imported address associated with it. |
Yep, it was almost surely that or something close to that. |
Fixes #1143 (and possibly others). Before this commit, (index plus gap limit) addresses are imported on sync, and addresses used by maker/taker in coinjoin are imported, but when a deposit occurred, bumping the index, further addresses were not imported. The effect was that it was possible, if doing a series of deposits to multiple external addresses in a Qt session, to end up depositing to an address that was not yet imported. And this results in the user needing to rescan for Core+JM to recognize the coins. After this commit, we ensure all 'gap limit forwards' addresses, which are displayed as potential deposit addresses in Joinmarket-Qt, are imported before the display.
693ce5e
to
ac8b173
Compare
Fixes #1143 (and possibly others). Before this commit,
(index plus gap limit) addresses are imported on sync,
and addresses used by maker/taker in coinjoin are imported,
but when a deposit occurred, bumping the index, further
addresses were not imported. The effect was that it was
possible, if doing a series of deposits to multiple
external addresses in a Qt session, to end up depositing
to an address that was not yet imported. And this results
in the user needing to rescan for Core+JM to recognize the
coins.
After this commit, we ensure all 'gap limit forwards'
addresses, which are displayed as potential deposit addresses
in Joinmarket-Qt, are imported before the display.