Skip to content

Commit

Permalink
fix: correct method on peer-book
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Mar 31, 2017
1 parent dee0340 commit 031ecb3
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 031ecb3

Please sign in to comment.