feat: prepare for new randomWalk config parameters

As per: https://github.com/libp2p/js-libp2p-kad-dht/issues/76

fix: pass whole dht config into DHT constructor
This commit is contained in:
Thomas Eizinger
2019-02-04 12:20:24 +11:00
committed by Jacob Heun
parent 679d446daa
commit 91e60d4253
5 changed files with 25 additions and 10 deletions

View File

@ -105,14 +105,10 @@ class Node extends EventEmitter {
// dht provided components (peerRouting, contentRouting, dht)
if (this._config.dht.enabled) {
const DHT = this._modules.dht
const enabledDiscovery = this._config.dht.enabledDiscovery !== false
this._dht = new DHT(this._switch, {
kBucketSize: this._config.dht.kBucketSize,
enabledDiscovery,
datastore: this.datastore,
validators: this._config.dht.validators,
selectors: this._config.dht.selectors
...this._config.dht
})
}