Skip to content

Commit

Permalink
Handled errors that bubble up from libp2p.start()
Browse files Browse the repository at this point in the history
  • Loading branch information
haadcode committed Nov 11, 2016
1 parent 2e15235 commit 47f2dfe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/components/libp2p.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ module.exports = function libp2p (self) {
return {
start: promisify((callback) => {
self._libp2pNode = new Libp2pNode(self._peerInfo)
self._libp2pNode.start(() => {
self._libp2pNode.start((err) => {
if (err) {
return callback(err)
}

// TODO connect to bootstrap nodes, it will get us more addrs
self._libp2pNode.peerInfo.multiaddrs.forEach((ma) => {
console.log('Swarm listening on', ma.toString())
Expand Down

0 comments on commit 47f2dfe

Please sign in to comment.