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

Commit

Permalink
feat: update to new libp2p events for peers
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Mar 29, 2017
1 parent 511e363 commit ca88706
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/components/libp2p.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ module.exports = function libp2p (self) {
console.log('Swarm listening on', ma.toString())
})

self._libp2pNode.on('peer', (peerInfo) => {
self._libp2pNode.on('peer:discovery', (peerInfo) => {
if (self.isOnline()) {
self._peerInfoBook.put(peerInfo)
self._libp2pNode.dial(peerInfo, () => {})
}
})
self._libp2pNode.swarm.on('peer-mux-established', (peerInfo) => {
self._libp2pNode.on('peer:connect', (peerInfo) => {
self._peerInfoBook.put(peerInfo)
})

Expand Down

0 comments on commit ca88706

Please sign in to comment.