Skip to content

Commit

Permalink
feat: append peer id to multiaddr if not there
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias authored and dryajov committed Jul 9, 2017
1 parent ff32671 commit ce6b0e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const Ping = require('libp2p-ping')
const Swarm = require('libp2p-swarm')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const mafmt = require('mafmt')
const PeerBook = require('peer-book')
const mafmt = require('mafmt')
const multiaddr = require('multiaddr')
Expand Down Expand Up @@ -70,6 +71,8 @@ class Node extends EventEmitter {

this.swarm.on('peer-mux-closed', (peerInfo) => {
this.emit('peer:disconnect', peerInfo)
// TODO remove this line
this.peerBook.removeByB58String(peerInfo.id.toB58String())
})
}

Expand Down

0 comments on commit ce6b0e3

Please sign in to comment.