Compare commits
2 Commits
21f7f2e67d
...
81191ed7ce
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 81191ed7ce | |
Derrick Hammer | f82a689e0f |
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAkBlC,eAAO,MAAM,YAAY,eAAuB,CAAC;AAEjD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,YAAY;IAChD,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,KAAK,CAAM;IACnB,OAAO,CAAC,QAAQ,CAAS;gBAEb,EACV,OAAkB,EAClB,GAAS,EACT,aAAiB,EACjB,EAA2B,EAC3B,KAAY,EACZ,QAAmB,GACpB;;;;;;;KAAK;IAmBN,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,SAAS;IA6CjB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,SAAW;IAenC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,SAAW;CAY1C"}
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAkBlC,eAAO,MAAM,YAAY,eAAuB,CAAC;AAEjD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,YAAY;IAChD,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,KAAK,CAAM;IACnB,OAAO,CAAC,QAAQ,CAAS;gBAEb,EACV,OAAkB,EAClB,GAAS,EACT,aAAiB,EACjB,EAA2B,EAC3B,KAAY,EACZ,QAAmB,GACpB;;;;;;;KAAK;IAmBN,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,SAAS;IA+CjB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,SAAW;IAenC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,SAAW;CAY1C"}
|
|
@ -68,7 +68,7 @@ class DHTFlood extends events_1.default {
|
||||||
const mux = protomux_1.default.from(peer);
|
const mux = protomux_1.default.from(peer);
|
||||||
let chan;
|
let chan;
|
||||||
const self = this;
|
const self = this;
|
||||||
if (!mux.opened({ protocol: PROTOCOL })) {
|
if (!mux.opened({ protocol: this.protocol })) {
|
||||||
chan = mux.createChannel({
|
chan = mux.createChannel({
|
||||||
protocol: this.protocol,
|
protocol: this.protocol,
|
||||||
async onopen() {
|
async onopen() {
|
||||||
|
@ -78,8 +78,10 @@ class DHTFlood extends events_1.default {
|
||||||
self.emit("peer-remove", peer);
|
self.emit("peer-remove", peer);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (chan) {
|
||||||
peer[exports.FLOOD_SYMBOL] = chan;
|
peer[exports.FLOOD_SYMBOL] = chan;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
chan = peer[exports.FLOOD_SYMBOL];
|
chan = peer[exports.FLOOD_SYMBOL];
|
||||||
if (!chan) {
|
if (!chan) {
|
||||||
throw new Error("could not find channel");
|
throw new Error("could not find channel");
|
||||||
|
|
|
@ -92,7 +92,7 @@ export default class DHTFlood extends EventEmitter {
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (!mux.opened({ protocol: PROTOCOL })) {
|
if (!mux.opened({ protocol: this.protocol })) {
|
||||||
chan = mux.createChannel({
|
chan = mux.createChannel({
|
||||||
protocol: this.protocol,
|
protocol: this.protocol,
|
||||||
async onopen() {
|
async onopen() {
|
||||||
|
@ -102,8 +102,10 @@ export default class DHTFlood extends EventEmitter {
|
||||||
self.emit("peer-remove", peer);
|
self.emit("peer-remove", peer);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (chan) {
|
||||||
peer[FLOOD_SYMBOL] = chan;
|
peer[FLOOD_SYMBOL] = chan;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
chan = peer[FLOOD_SYMBOL];
|
chan = peer[FLOOD_SYMBOL];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue