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
p2p
go-p2p-core
Commits
075ac748
Unverified
Commit
075ac748
authored
Mar 25, 2020
by
Vibhav Pant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(*PeerRecord.MarshalRecord): Use ToProtobuf() to get protobuf struct
parent
4013be10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
peer/record.go
peer/record.go
+2
-7
No files found.
peer/record.go
View file @
075ac748
...
@@ -153,16 +153,11 @@ func (r *PeerRecord) UnmarshalRecord(bytes []byte) error {
...
@@ -153,16 +153,11 @@ func (r *PeerRecord) UnmarshalRecord(bytes []byte) error {
// This method is called automatically when constructing a routing.Envelope
// This method is called automatically when constructing a routing.Envelope
// using Seal or PeerRecord.Sign.
// using Seal or PeerRecord.Sign.
func
(
r
*
PeerRecord
)
MarshalRecord
()
([]
byte
,
error
)
{
func
(
r
*
PeerRecord
)
MarshalRecord
()
([]
byte
,
error
)
{
idBytes
,
err
:=
r
.
PeerID
.
MarshalBinary
()
msg
,
err
:=
r
.
ToProtobuf
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
msg
:=
pb
.
PeerRecord
{
return
proto
.
Marshal
(
msg
)
PeerId
:
idBytes
,
Addresses
:
addrsToProtobuf
(
r
.
Addrs
),
Seq
:
r
.
Seq
,
}
return
proto
.
Marshal
(
&
msg
)
}
}
// Equal returns true if the other PeerRecord is identical to this one.
// Equal returns true if the other PeerRecord is identical to this one.
...
...
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