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
8b7bf266
Commit
8b7bf266
authored
May 11, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p: add peer address to peerstore if specified
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
633b04e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
core/commands/p2p.go
core/commands/p2p.go
+7
-2
No files found.
core/commands/p2p.go
View file @
8b7bf266
...
...
@@ -11,8 +11,9 @@ import (
cmds
"github.com/ipfs/go-ipfs/commands"
core
"github.com/ipfs/go-ipfs/core"
"gx/ipfs/Qm
SP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit
"
pstore
"gx/ipfs/Qm
XauCuJzmzapetmC6W4TuDJLL1yFFrVzSHoWv8YdbmnxH/go-libp2p-peerstore
"
ma
"gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr"
"gx/ipfs/QmdE4gMduCKCGAcczM2F5ioYDfdeKuPix138wrES1YSr7f/go-ipfs-cmdkit"
)
// P2PListenerInfoOutput is output type of ls command
...
...
@@ -267,12 +268,16 @@ can transparently connect to a p2p service.
return
}
_
,
peer
,
err
:=
ParsePeerParam
(
req
.
Arguments
()[
0
])
addr
,
peer
,
err
:=
ParsePeerParam
(
req
.
Arguments
()[
0
])
if
err
!=
nil
{
res
.
SetError
(
err
,
cmdkit
.
ErrNormal
)
return
}
if
addr
!=
nil
{
n
.
Peerstore
.
AddAddr
(
peer
,
addr
,
pstore
.
TempAddrTTL
)
}
proto
:=
"/p2p/"
+
req
.
Arguments
()[
1
]
bindAddr
,
_
:=
ma
.
NewMultiaddr
(
"/ip4/127.0.0.1/tcp/0"
)
...
...
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