*Explicitly define protocol as a bag option

This commit is contained in:
Derrick Hammer 2022-11-16 12:04:56 -05:00
parent cf6e0a986f
commit cea5ba5131
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 2 deletions

View File

@ -9,10 +9,15 @@ export default class DHTOnline extends DHTOnlineBase {
constructor(
swarm: any,
{ id = swarm.keyPair.publicKey, data = {}, ...opts } = {}
{
id = swarm.keyPair.publicKey,
data = {},
protocol = undefined,
...opts
} = {}
) {
super(id, opts);
this.flood = new DHTFlood({ id, swarm, ...opts });
this.flood = new DHTFlood({ id, swarm, protocol, ...opts });
this.swarm = swarm;
this.flood.on("peer-open", (peer) => this.handlePeerAdd(peer));