Skip to content

Commit

Permalink
encode peer id as hex in rpc response
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Mar 5, 2019
1 parent 8f5477f commit 6742542
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torrent/rpchandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package torrent

import (
"encoding/base64"
"encoding/hex"
"errors"
"net"
"strconv"
Expand Down Expand Up @@ -242,7 +243,7 @@ func (h *rpcHandler) GetTorrentPeers(args *rpctypes.GetTorrentPeersRequest, repl
panic("unhandled peer source")
}
reply.Peers[i] = rpctypes.Peer{
ID: string(p.ID[:]),
ID: hex.EncodeToString(p.ID[:]),
Client: p.Client,
Addr: p.Addr.String(),
Source: source,
Expand Down

0 comments on commit 6742542

Please sign in to comment.