-
Notifications
You must be signed in to change notification settings - Fork 649
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
Fixed saving keys in wallet #1613
Fixed saving keys in wallet #1613
Conversation
Thanks! Can be possible for you to make a test case in |
In another note, this pull request should point to the |
Oh. My. God. IMO what the wallet does here is completely broken. (Not your fault, @pixelplex ).
It doesn't store the owner key anywhere. Makes some sense, assuming that the owner key is stored externally (e. g. in the form of the brain key). This should be documented. The fix proposed in this PR does not help with any of this AFAICS. IMO these problems need to be resolved at another level, perhaps in the context of #151. |
6a90c97
to
1b140d2
Compare
@oxarbitrage I have changed the base branch |
I guess we have worked on a similar issue in the past. See #235. At least the wallet doesn't generate a key from nowhere then lose it.
I agree with @pmconrad that there are issues related to accounts in cli_wallet (#151). Is there any typical use case that relies on those features? |
Another related issue is #71 |
The |
Unfortunately, @pmconrad , could you please describe the problem in detail? So far the only obvious bottleneck is this one: @abitmore your documentation states that About the FC version - okay, we will update it a little bit later |
Problem 1: keys must not be saved to disk in plaintext. Problem 2 is probably somewhat academic. |
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.
IMO we should merge this because it is an improvement over the current behaviour. The key handling still needs a more general overhaul, hopefully in the context of #151 .
Thanks @pixelplex !
When a new account is created, its private keys must be added to a wallet. Key addition must happen only after the account is created on the blockchain.
Problem:
After an account is created, its keys are put into a temporary data structure (pending_account_registrations), stored in the wallet. After this, the wallet (in JSON format) is recorded into a file (wallet.json). Once a new block is added, a check is performed on whether the account was created on the blockchain. If it was created, its keys are put into _keys data structure, which is stored in the wallet. However, these keys are not re-recorded into the wallet file (wallet.json) in the encoded format (variable cipher_keys) and are not removed from the temporary data structure (pending_account_registrations). Because of this, if the wallet is stopped and restarted, new keys are not added to data structure _keys, stored in the wallet. Which leads to the new account not being able to sign transactions.
The fix is presented in the request.