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

SDK throws an error on seed mismatch to stored credentials #374

Open
dangeross opened this issue Aug 4, 2023 · 4 comments
Open

SDK throws an error on seed mismatch to stored credentials #374

dangeross opened this issue Aug 4, 2023 · 4 comments
Assignees

Comments

@dangeross
Copy link
Collaborator

When trying to connect the SDK with a seed different to the encrypted credential, SDK throws an error:

Failed to decrypt credentials, seed doesn't match existing node

This can be handled by creating a different working directory for the SDK to use with the different seed, but that is not immediately obvious to a developer.

@ok300
Copy link
Contributor

ok300 commented Aug 24, 2023

How about, if that happens, we delete the local sql files and re-populate them based on the new seed?

I find myself doing this a lot during tests, when switching between wallets.

It can be made configurable, or with a new flag added to connect.

@ok300
Copy link
Contributor

ok300 commented Aug 24, 2023

Alternatively, we could store the DB files in a per-wallet subfolder, whose name is derived from the seed (HD wallet fingerprint).

Each new restore would then access the files from the matching DB, or create a new subfolder.

@dangeross
Copy link
Collaborator Author

dangeross commented Aug 24, 2023

Alternatively, we could store the DB files in a per-wallet subfolder, whose name is derived from the seed (HD wallet fingerprint).

Each new restore would then access the files from the matching DB, or create a new subfolder.

This would better suit the multi-instance scenario, where different HWW determine the seed. I think Roy mentioned also having a method to clear the state cache for a particular seed (or with an optional flag when calling disconnect)

@roeierez
Copy link
Member

This would better suit the multi-instance scenario, where different HWW determine the seed. I think Roy mentioned also having a method to clear the state cache for a particular seed (or with an optional flag when calling disconnect)

I like this approach.

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

No branches or pull requests

4 participants