Skip to content

Commit

Permalink
chore: add notice for addressBook.set
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos authored and jacobheun committed Aug 27, 2020
1 parent ca57e65 commit cd09327
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,8 @@ peerStore.addressBook.getMultiaddrsForPeer(peerId)

### peerStore.addressBook.set

Set known `multiaddrs` of a given peer.
Set known `multiaddrs` of a given peer. This will replace previously stored multiaddrs, if available.
Replacing stored multiaddrs might result in losing obtained certified addresses, which is not desirable.

`peerStore.addressBook.set(peerId, multiaddrs)`

Expand Down
2 changes: 2 additions & 0 deletions src/peer-store/address-book.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ class AddressBook extends Book {

/**
* Set known multiaddrs of a provided peer.
* This will replace previously stored multiaddrs, if available.
* Replacing stored multiaddrs might result in losing obtained certified addresses.
* @override
* @param {PeerId} peerId
* @param {Array<Multiaddr>} multiaddrs
Expand Down

0 comments on commit cd09327

Please sign in to comment.