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
d6b94360
Commit
d6b94360
authored
Aug 08, 2020
by
Adin Schmahmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: sort protocols returned by ipfs id
parent
dd47364e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
core/commands/id.go
core/commands/id.go
+3
-0
No files found.
core/commands/id.go
View file @
d6b94360
...
...
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"sort"
"strings"
version
"github.com/ipfs/go-ipfs"
...
...
@@ -172,6 +173,7 @@ func printPeer(ps pstore.Peerstore, p peer.ID) (interface{}, error) {
for
_
,
p
:=
range
protocols
{
info
.
Protocols
=
append
(
info
.
Protocols
,
string
(
p
))
}
sort
.
Strings
(
info
.
Protocols
)
if
v
,
err
:=
ps
.
Get
(
p
,
"ProtocolVersion"
);
err
==
nil
{
if
vs
,
ok
:=
v
.
(
string
);
ok
{
...
...
@@ -208,6 +210,7 @@ func printSelf(node *core.IpfsNode) (interface{}, error) {
info
.
Addresses
=
append
(
info
.
Addresses
,
a
.
String
())
}
info
.
Protocols
=
node
.
PeerHost
.
Mux
()
.
Protocols
()
sort
.
Strings
(
info
.
Protocols
)
}
info
.
ProtocolVersion
=
identify
.
LibP2PVersion
info
.
AgentVersion
=
version
.
UserAgent
...
...
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