Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
addSafe notes
Browse files Browse the repository at this point in the history
  • Loading branch information
hackergrrl committed Apr 12, 2016
1 parent 1a757d8 commit c8f577a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ a [multiaddr](https://github.com/jbenet/js-multiaddr).

## peer.multiaddr.addSafe(addr)

Adds a new multiaddress that `peer` can be reached at.

..Safely? **TODO**
The `addSafe` call, in comparison to `add`, will only add the multiaddr to
`multiaddrs` if the same multiaddr tries to be added twice.

This is a simple mechanism to prevent `multiaddrs` from becoming bloated with
unusable addresses, which happens when we exchange observed multiaddrs with
peers which will not provide a useful multiaddr to be shared to the rest of the
network (e.g. a multiaddr referring to a peer inside a LAN being shared to the
outside world).

## peer.multiaddr.rm(addr)

Expand Down

0 comments on commit c8f577a

Please sign in to comment.