Skip to content

Commit

Permalink
Add to comment on KeyBook.PrivKey (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix authored Apr 8, 2019
1 parent 4943e51 commit 25d32c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions p2p/host/peerstore/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,15 @@ type AddrBook interface {

// KeyBook tracks the keys of Peers.
type KeyBook interface {

// PubKey stores the public key of a peer.
PubKey(peer.ID) ic.PubKey

// AddPubKey stores the public key of a peer.
AddPubKey(peer.ID, ic.PubKey) error

// PrivKey returns the private key of a peer.
// PrivKey returns the private key of a peer, if known. Generally this might only be our own
// private key, see
// https://discuss.libp2p.io/t/what-is-the-purpose-of-having-map-peer-id-privatekey-in-peerstore/74.
PrivKey(peer.ID) ic.PrivKey

// AddPrivKey stores the private key of a peer.
Expand Down

0 comments on commit 25d32c5

Please sign in to comment.