mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-28 05:11:04 +00:00
cr
This commit is contained in:
parent
2c23d9a718
commit
d27bd2b912
@ -142,13 +142,13 @@ class Node extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ping (peer, callback) {
|
ping (peer, callback) {
|
||||||
assert(this.isOn, OFFLINE_ERROR_MESSAGE)
|
assert(this.isOn(), OFFLINE_ERROR_MESSAGE)
|
||||||
const peerInfo = this._getPeerInfo(peer)
|
const peerInfo = this._getPeerInfo(peer)
|
||||||
callback(null, new Ping(this.swarm, peerInfo))
|
callback(null, new Ping(this.swarm, peerInfo))
|
||||||
}
|
}
|
||||||
|
|
||||||
dial (peer, protocol, callback) {
|
dial (peer, protocol, callback) {
|
||||||
assert(this.isOnline, OFFLINE_ERROR_MESSAGE)
|
assert(this.isOn(), OFFLINE_ERROR_MESSAGE)
|
||||||
const peerInfo = this._getPeerInfo(peer)
|
const peerInfo = this._getPeerInfo(peer)
|
||||||
|
|
||||||
if (typeof protocol === 'function') {
|
if (typeof protocol === 'function') {
|
||||||
@ -166,7 +166,7 @@ class Node extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hangUp (peer, callback) {
|
hangUp (peer, callback) {
|
||||||
assert(this.isOnline, OFFLINE_ERROR_MESSAGE)
|
assert(this.isOn(), OFFLINE_ERROR_MESSAGE)
|
||||||
const peerInfo = this._getPeerInfo(peer)
|
const peerInfo = this._getPeerInfo(peer)
|
||||||
|
|
||||||
this.peerBook.removeByB58String(peerInfo.id.toB58String())
|
this.peerBook.removeByB58String(peerInfo.id.toB58String())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user