Browse Source

update id directly

v4
Mathias Buus 5 years ago
parent
commit
a85df37327
  1. 4
      index.js
  2. 4
      lib/io.js

4
index.js

@ -341,12 +341,12 @@ class DHT extends EventEmitter {
setEphemeral (ephemeral = false, cb) {
if (ephemeral === true) {
this._io._updateId(null)
this._io.id = null
this.ephemeral = true
if (cb) process.nextTick(cb)
return
}
this._io._updateId(this.id)
this._io.id = this.id
this.bootstrap((err) => {
if (err) {
if (cb) cb(err)

4
lib/io.js

@ -294,10 +294,6 @@ class IO {
value
}, peer, callback)
}
_updateId (id) {
this.id = id
}
}
IO.QUERY = QUERY

Loading…
Cancel
Save