Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
b63e10f3
Commit
b63e10f3
authored
Sep 11, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: Don't require address for node initialization
parent
7b32c113
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
core/core.go
core/core.go
+10
-4
No files found.
core/core.go
View file @
b63e10f3
...
...
@@ -122,9 +122,15 @@ func initIdentity(cfg *config.Config) (*peer.Peer, error) {
return
nil
,
errors
.
New
(
"No peer ID in config! (was ipfs init run?)"
)
}
maddr
,
err
:=
ma
.
NewMultiaddr
(
cfg
.
Identity
.
Address
)
if
err
!=
nil
{
return
nil
,
err
// address is optional
var
addresses
[]
*
ma
.
Multiaddr
if
len
(
cfg
.
Identity
.
Address
)
>
0
{
maddr
,
err
:=
ma
.
NewMultiaddr
(
cfg
.
Identity
.
Address
)
if
err
!=
nil
{
return
nil
,
err
}
addresses
=
[]
*
ma
.
Multiaddr
{
maddr
}
}
skb
,
err
:=
base64
.
StdEncoding
.
DecodeString
(
cfg
.
Identity
.
PrivKey
)
...
...
@@ -139,7 +145,7 @@ func initIdentity(cfg *config.Config) (*peer.Peer, error) {
return
&
peer
.
Peer
{
ID
:
peer
.
ID
(
b58
.
Decode
(
cfg
.
Identity
.
PeerID
)),
Addresses
:
[]
*
ma
.
Multiaddr
{
maddr
}
,
Addresses
:
addresses
,
PrivKey
:
sk
,
PubKey
:
sk
.
GetPublic
(),
},
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment