Skip to content

Commit

Permalink
PeerInfo UnMarshal Error #393
Browse files Browse the repository at this point in the history
  • Loading branch information
wzp committed Nov 8, 2018
1 parent 64945af commit 5d053a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2p/host/peerstore/peerinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ func InfoToP2pAddrs(pi *PeerInfo) ([]ma.Multiaddr, error) {
return addrs, nil
}

func (pi *PeerInfo) Loggable() map[string]interface{} {
func (pi PeerInfo) Loggable() map[string]interface{} {
return map[string]interface{}{
"peerID": pi.ID.Pretty(),
"addrs": pi.Addrs,
}
}

func (pi *PeerInfo) MarshalJSON() ([]byte, error) {
func (pi PeerInfo) MarshalJSON() ([]byte, error) {
out := make(map[string]interface{})
out["ID"] = pi.ID.Pretty()
var addrs []string
Expand All @@ -88,7 +88,7 @@ func (pi *PeerInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(out)
}

func (pi *PeerInfo) UnmarshalJSON(b []byte) error {
func (pi PeerInfo) UnmarshalJSON(b []byte) error {
var data map[string]interface{}
err := json.Unmarshal(b, &data)
if err != nil {
Expand Down

0 comments on commit 5d053a2

Please sign in to comment.