*Bug fix channel opening

This commit is contained in:
Derrick Hammer 2022-11-26 18:09:20 -05:00
parent 21f7f2e67d
commit f82a689e0f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 2 deletions

View File

@ -92,7 +92,7 @@ export default class DHTFlood extends EventEmitter {
const self = this;
if (!mux.opened({ protocol: PROTOCOL })) {
if (!mux.opened({ protocol: this.protocol })) {
chan = mux.createChannel({
protocol: this.protocol,
async onopen() {
@ -102,7 +102,9 @@ export default class DHTFlood extends EventEmitter {
self.emit("peer-remove", peer);
},
});
peer[FLOOD_SYMBOL] = chan;
if (chan) {
peer[FLOOD_SYMBOL] = chan;
}
}
chan = peer[FLOOD_SYMBOL];