*Change closedMap to a Set
*If we dont have the peer in the closedMap, add it
This commit is contained in:
parent
340cd46734
commit
ead991f9af
|
@ -18,7 +18,7 @@ const PROTOCOL = "lumeweb.flood";
|
||||||
|
|
||||||
export const FLOOD_SYMBOL = Symbol.for(PROTOCOL);
|
export const FLOOD_SYMBOL = Symbol.for(PROTOCOL);
|
||||||
|
|
||||||
const closedMap = new Map();
|
const closedMap = new Set();
|
||||||
|
|
||||||
export default class DHTFlood extends EventEmitter {
|
export default class DHTFlood extends EventEmitter {
|
||||||
private id: Buffer;
|
private id: Buffer;
|
||||||
|
@ -113,6 +113,7 @@ export default class DHTFlood extends EventEmitter {
|
||||||
};
|
};
|
||||||
|
|
||||||
peer.on("close", close);
|
peer.on("close", close);
|
||||||
|
closedMap.add(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
chan = peer[FLOOD_SYMBOL];
|
chan = peer[FLOOD_SYMBOL];
|
||||||
|
|
Loading…
Reference in New Issue