-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
core:fix error load private key in offline model #4980
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
Conversation
License: MIT Signed-off-by: zhangkejie <[email protected]>
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.
@Kubuxu or @whyrusleeping, do you remember why we initialize offline routing on-demand instead of on start (like we do with online routing)?
err := n.LoadPrivateKey() | ||
if err != nil { | ||
return err | ||
if n.PrivateKey == nil { |
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.
I'd actually put this check inside LoadPrivateKey
and get rid of the error there if the private key is already loaded.
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.
i think put it in LoadPrivateKey can not slove this problem,you can see issue #4978,i have fix this issue .what's more u can see the 196 line of the code in core/command/id.go,we should add the judgment in the project
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.
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.
Sorry, my suggestion was to make LoadPrivateKey
return success if the private key is already loaded instead of returning an error. That should fix the issue unless I'm missing something.
@kjzz could you add a sharness test for this bugfix. I think the best way to do it is to add it in |
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.
@Stebalien I don't know.
@Kubuxu ok,i will.thank u |
Fix issue #4978
License:MIT
Signed-off-by: zhangkejie [email protected]