Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
65273ab3
Commit
65273ab3
authored
Sep 11, 2016
by
jbenet
Browse files
identify: send public key in message
parent
b45c8979
Changes
1
Show whitespace changes
Inline
Side-by-side
p2p/protocol/identify/id.go
View file @
65273ab3
...
@@ -164,6 +164,17 @@ func (ids *IDService) populateMessage(mes *pb.Identify, c inet.Conn) {
...
@@ -164,6 +164,17 @@ func (ids *IDService) populateMessage(mes *pb.Identify, c inet.Conn) {
}
}
log
.
Debugf
(
"%s sent listen addrs to %s: %s"
,
c
.
LocalPeer
(),
c
.
RemotePeer
(),
laddrs
)
log
.
Debugf
(
"%s sent listen addrs to %s: %s"
,
c
.
LocalPeer
(),
c
.
RemotePeer
(),
laddrs
)
ownKey
:=
ids
.
Host
.
Peerstore
()
.
PubKey
(
ids
.
Host
.
ID
())
if
ownKey
==
nil
{
log
.
Errorf
(
"did not have own public key in Peerstore"
)
}
else
{
if
kb
,
err
:=
ownKey
.
Bytes
();
err
!=
nil
{
log
.
Errorf
(
"failed to convert key to bytes"
)
}
else
{
mes
.
PublicKey
=
kb
}
}
// set protocol versions
// set protocol versions
pv
:=
LibP2PVersion
pv
:=
LibP2PVersion
av
:=
ClientVersion
av
:=
ClientVersion
...
...
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