diff --git a/index.js b/index.js index 9261059..cbe2250 100644 --- a/index.js +++ b/index.js @@ -35,8 +35,7 @@ module.exports = class Hyperswarm extends EventEmitter { this.dht = opts.dht || new DHT({ bootstrap: opts.bootstrap, - debug: opts.debug, - knownNodes: opts.knownNodes + nodes: opts.nodes }) this.server = this.dht.createServer({ firewall: this._handleFirewall.bind(this), diff --git a/test/swarm.js b/test/swarm.js index c548497..662e8c8 100644 --- a/test/swarm.js +++ b/test/swarm.js @@ -418,57 +418,6 @@ test('one server, one client - correct deduplication when a client connection is swarm2.join(topic, { server: false, client: true }) }) -test('constructor options - debug options forwarded to DHT constructor', async (t) => { - const { bootstrap } = await createTestnet(3, t.teardown) - - const swarm1 = new Hyperswarm({ - bootstrap, - backoffs: BACKOFFS, - jitter: 0, - debug: { - handshake: { - latency: [500, 500] - } - } - }) - const swarm2 = new Hyperswarm({ - bootstrap, - backoffs: BACKOFFS, - jitter: 0, - debug: { - handshake: { - latency: [500, 500] - } - } - }) - - const connected = t.test('connection') - connected.plan(2) - - swarm1.once('connection', (conn) => { - connected.pass('swarm1') - conn.on('error', noop) - }) - swarm2.once('connection', (conn) => { - connected.pass('swarm2') - conn.on('error', noop) - }) - - const topic = Buffer.alloc(32).fill('hello world') - await swarm1.join(topic, { server: true }).flushed() - - const start = Date.now() - swarm2.join(topic, { client: true }) - - await connected - - const duration = Date.now() - start - t.ok(duration > 500) - - await swarm1.destroy() - await swarm2.destroy() -}) - test('flush when max connections reached', async (t) => { const { bootstrap } = await createTestnet(3, t.teardown)