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

Commit

Permalink
account peer in peer-mux-established event
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed May 25, 2016
1 parent b8abec3 commit 8a470c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -74,7 +74,7 @@
"joi": "^8.0.5",
"libp2p-ipfs": "^0.8.1",
"libp2p-ipfs-browser": "^0.7.0",
"libp2p-swarm": "^0.18.1",
"libp2p-swarm": "^0.18.2",
"lodash.get": "^4.3.0",
"lodash.set": "^4.2.0",
"multiaddr": "^2.0.2",
Expand Down Expand Up @@ -122,4 +122,4 @@
"kumavis <kumavis@users.noreply.github.com>",
"nginnever <ginneversource@gmail.com>"
]
}
}
3 changes: 3 additions & 0 deletions src/core/ipfs/libp2p.js
Expand Up @@ -23,6 +23,9 @@ module.exports = function libp2p (self) {
self._peerInfoBook.put(peerInfo)
self._libp2pNode.swarm.dial(peerInfo)
})
self._libp2pNode.swarm.on('peer-mux-established', (peerInfo) => {
self._peerInfoBook.put(peerInfo)
})
},
stop: (callback) => {
self._libp2pNode.swarm.close(callback)
Expand Down

0 comments on commit 8a470c2

Please sign in to comment.