mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-03 00:01:04 +00:00
Merge pull request #85 from libp2p/feat/advanced-peer-book
fix: correct method on peer-book
This commit is contained in:
commit
a48ec65961
@ -211,7 +211,7 @@ class Node extends EventEmitter {
|
|||||||
} else if (multiaddr.isMultiaddr(peer)) {
|
} else if (multiaddr.isMultiaddr(peer)) {
|
||||||
const peerIdB58Str = peer.getPeerId()
|
const peerIdB58Str = peer.getPeerId()
|
||||||
try {
|
try {
|
||||||
p = this.peerBook.getByB58String(peerIdB58Str)
|
p = this.peerBook.get(peerIdB58Str)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
p = new PeerInfo(PeerId.createFromB58String(peerIdB58Str))
|
p = new PeerInfo(PeerId.createFromB58String(peerIdB58Str))
|
||||||
}
|
}
|
||||||
@ -219,7 +219,7 @@ class Node extends EventEmitter {
|
|||||||
} else if (PeerId.isPeerId(peer)) {
|
} else if (PeerId.isPeerId(peer)) {
|
||||||
const peerIdB58Str = peer.toB58String()
|
const peerIdB58Str = peer.toB58String()
|
||||||
try {
|
try {
|
||||||
p = this.peerBook.getByB58String(peerIdB58Str)
|
p = this.peerBook.get(peerIdB58Str)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// TODO this is where PeerRouting comes into place
|
// TODO this is where PeerRouting comes into place
|
||||||
throw new Error('No knowledge about: ' + peerIdB58Str)
|
throw new Error('No knowledge about: ' + peerIdB58Str)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user