Skip to content

Commit

Permalink
Merge pull request #85 from libp2p/feat/advanced-peer-book
Browse files Browse the repository at this point in the history
fix: correct method on peer-book
  • Loading branch information
daviddias authored Mar 31, 2017
2 parents c6bdd86 + 031ecb3 commit a48ec65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ class Node extends EventEmitter {
} else if (multiaddr.isMultiaddr(peer)) {
const peerIdB58Str = peer.getPeerId()
try {
p = this.peerBook.getByB58String(peerIdB58Str)
p = this.peerBook.get(peerIdB58Str)
} catch (err) {
p = new PeerInfo(PeerId.createFromB58String(peerIdB58Str))
}
p.multiaddrs.add(peer)
} else if (PeerId.isPeerId(peer)) {
const peerIdB58Str = peer.toB58String()
try {
p = this.peerBook.getByB58String(peerIdB58Str)
p = this.peerBook.get(peerIdB58Str)
} catch (err) {
// TODO this is where PeerRouting comes into place
throw new Error('No knowledge about: ' + peerIdB58Str)
Expand Down

0 comments on commit a48ec65

Please sign in to comment.