Commit 5ee455b5 authored by Steven Allen's avatar Steven Allen

chore: make code climate happy

1. Yes, I like my symmetry.
2. No, we don't want to stash the private key if we fail to put it in the peerstore.

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent 9a9310df
...@@ -814,13 +814,13 @@ func (n *IpfsNode) loadPrivateKey() error { ...@@ -814,13 +814,13 @@ func (n *IpfsNode) loadPrivateKey() error {
return err return err
} }
n.PrivateKey = sk if err := n.Peerstore.AddPrivKey(n.Identity, sk); err != nil {
if err := n.Peerstore.AddPrivKey(n.Identity, n.PrivateKey); err != nil {
return err return err
} }
if err := n.Peerstore.AddPubKey(n.Identity, sk.GetPublic()); err != nil { if err := n.Peerstore.AddPubKey(n.Identity, sk.GetPublic()); err != nil {
return err return err
} }
n.PrivateKey = sk
return nil return nil
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment