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

feat: new peer-info #542

Merged
merged 2 commits into from
Mar 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"coverage-publish": "aegir-coverage publish"
},
"dependencies": {
"async": "^2.1.5",
"async": "^2.2.0",
"bs58": "^4.0.0",
"cids": "~0.4.2",
"concat-stream": "^1.6.0",
Expand All @@ -36,13 +36,13 @@
"is-ipfs": "~0.3.0",
"isstream": "^0.1.2",
"lru-cache": "^4.0.2",
"multiaddr": "^2.2.2",
"multihashes": "~0.4.4",
"multiaddr": "^2.3.0",
"multihashes": "~0.4.5",
"multipart-stream": "^2.0.1",
"ndjson": "^1.5.0",
"once": "^1.4.0",
"peer-id": "~0.8.4",
"peer-info": "~0.8.4",
"peer-id": "~0.8.6",
"peer-info": "~0.9.0",
"promisify-es6": "^1.0.2",
"pump": "^1.0.2",
"qs": "^6.4.0",
Expand All @@ -66,7 +66,7 @@
"eslint-plugin-react": "^6.10.3",
"gulp": "^3.9.1",
"hapi": "^16.1.0",
"interface-ipfs-core": "~0.26.0",
"interface-ipfs-core": "~0.26.1",
"ipfsd-ctl": "~0.20.0",
"pre-commit": "^1.2.2",
"socket.io": "^1.7.3",
Expand Down Expand Up @@ -127,4 +127,4 @@
"url": "https://github.com/ipfs/js-ipfs-api/issues"
},
"homepage": "https://github.com/ipfs/js-ipfs-api"
}
}
7 changes: 3 additions & 4 deletions src/api/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,11 @@ module.exports = (send) => {
}

const peers = Object.keys(result.Addrs).map((id) => {
const info = new PeerInfo(PeerId.createFromB58String(id))
const peerInfo = new PeerInfo(PeerId.createFromB58String(id))
result.Addrs[id].forEach((addr) => {
info.multiaddr.add(multiaddr(addr))
peerInfo.multiaddrs.add(multiaddr(addr))
})

return info
return peerInfo
})

callback(null, peers)
Expand Down