-
Notifications
You must be signed in to change notification settings - Fork 179
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
RPC-API: read gaplimit from config #1525
Conversation
Prior to this commit, an attempt to change the gap limit used in wallet syncing, by setting gaplimit in the config via configset, would fail, since gaplimit was only being read from command line options. After this commit, the value of gaplimit in the POLICY section of the config, defaulting to 6, will be read and used in Wallet object creation, either via the createwallet or recoverwallet endpoints, or via the wallet opening operation in the unlockwallet endpoint. This can be used in combination with the rescanblockchain endpoint to allow discovery of funds in addresses beyond the default gap.
This addresses the issue identified by @theborakompanioni here. |
Perhaps a note can be dropped somewhere that, in the scenario: you have a seedphrase, you recover, it doesn't show all funds, and you think it's because there are gaps of more than 6 addresses then:
|
tACK! Works as expected. Thanks @AdamISZ for fixing this so quickly and cleanly 🙏
These steps do not work as described, as deleting a wallet is not possible via the API - which is totally fine. Recovering a second time with a different filename leaves the user with two wallets, which should probably also be avoided. So currently (work in progress!), in Jam, the following approach is taken automatically, without further user intervention:
This successfully recovered all funds described in the mentioned scenario. Do you think this approach is sound?
|
Would it be reasonable/possible to add the |
Ah yes my bad, although it's referred to indirectly, I should have made that very explicit in the commit comment, as it is a separate edit. |
Yes, I think it is. It's a little unobvious how |
It did cross my mind. It's possible. But it does bring into clearer perspective, the slight ugliness we have in the architecture here: how the config is used. As you know, there's a default in-code, then there's a I guess the reason I didn't decide to include gaplimit in the recover endpoint is as per the above, the gaplimit is a global setting. The awkwardness of having to make sure a wallet's loaded to use it, comes from the above described error in design; we should just fix that, then it's a one-shot instruction to globally change it any time you need to. |
Yep, we talked about that. I was more or less thinking about an optional parameter which defaults to the config file value if it is not provided in the request. No persistence would be necessary. However, you are right, we should not talk about it here in this PR.
Yes, I guess it has to do with authentication/authorization. So it is not completely arbitrary and "kind of makes sense".
Totally okay! I do not want to hijack this PR. It works, and that is all that is needed for now. Thank you 🙏 Looking forward to this being merged! 🚀 |
OK thanks, I will take that as a tACK and merge. Will open an issue on the |
Prior to this commit, an attempt to change the gap limit used in wallet syncing, by setting gaplimit in the config via configset, would fail, since gaplimit was only being read from command line options. After this commit, the value of gaplimit in the POLICY section of the config, defaulting to 6, will be read and used in Wallet object creation, either via the createwallet or recoverwallet endpoints, or via the wallet opening operation in the unlockwallet endpoint. This can be used in combination with the rescanblockchain endpoint to allow discovery of funds in addresses beyond the default gap.