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

Commit

Permalink
feat: new peer-info (#542)
Browse files Browse the repository at this point in the history
* feat: new peer-info
  • Loading branch information
daviddias authored Mar 30, 2017
1 parent 17636a9 commit 820150c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
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

0 comments on commit 820150c

Please sign in to comment.