Skip to content

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

Closed
wants to merge 1 commit into from
Closed

core:fix error load private key in offline model #4980

wants to merge 1 commit into from

Conversation

kjzz
Copy link
Contributor

@kjzz kjzz commented Apr 26, 2018

Fix issue #4978

License:MIT
Signed-off-by: zhangkejie [email protected]

Copy link
Member

@Stebalien Stebalien left a 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 {
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

@Kubuxu
Copy link
Member

Kubuxu commented May 7, 2018

@kjzz could you add a sharness test for this bugfix. I think the best way to do it is to add it in test/sharness/t0600-issues-and-regressions-online.sh start a node with --offline parameter (you can do that by passing and argument after test_launch_ipfs_daemon) and perform the steps to reproduce after that.

Kubuxu
Kubuxu previously approved these changes May 7, 2018
Copy link
Member

@Kubuxu Kubuxu left a 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 Kubuxu dismissed their stale review May 7, 2018 12:50

because

@kjzz
Copy link
Contributor Author

kjzz commented May 7, 2018

@Kubuxu ok,i will.thank u

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

Successfully merging this pull request may close these issues.

3 participants