Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 7915818

Browse files
authored
Add peers with errors to swarm.peers definition
js-ipfs-api can encounter individual peer info objects that have newer multiaddrs or, in theory, a new format for PeerId that it cannot parse. Allowing for individiual peerInfo validation errors allows us to return a response which has the right number of peers in, and peerId and multiaddr info for all the other peers that could be validated, along with a info about peers that failed to validate. See: ipfs-inactive/js-ipfs-http-client#887
1 parent 19183ca commit 7915818

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

SPEC/SWARM.md

+7
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ Starting with `go-ipfs 0.4.5` these additional properties are provided
102102
- `muxer: String` - The type of stream muxer the peer is usng
103103
- `streams: []String` - Only if `verbose: true`, a list of currently open streams
104104

105+
If an error occurs trying to create an individual `peerInfo` object, it will have the properties
106+
107+
- `error: Error` - the error that occurred
108+
- `rawPeerInfo: Object` - the raw data for the peer
109+
110+
and all other properties may be undefined.
111+
105112
If no `callback` is passed, a promise is returned.
106113

107114
**Example:**

0 commit comments

Comments
 (0)