*Change closedMap to a Set

*If we dont have the peer in the closedMap, add it
This commit is contained in:
Derrick Hammer 2022-12-05 04:46:33 -05:00
parent 340cd46734
commit ead991f9af
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,7 @@ const PROTOCOL = "lumeweb.flood";
export const FLOOD_SYMBOL = Symbol.for(PROTOCOL);
const closedMap = new Map();
const closedMap = new Set();
export default class DHTFlood extends EventEmitter {
private id: Buffer;
@ -113,6 +113,7 @@ export default class DHTFlood extends EventEmitter {
};
peer.on("close", close);
closedMap.add(peer);
}
chan = peer[FLOOD_SYMBOL];