Add to comment on KeyBook.PrivKey (#64)

This commit is contained in:
Matt Joiner 2019-04-08 18:11:34 +10:00 committed by GitHub
parent d9cfa764ad
commit 9ae3eaaeb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.