Compare commits

..

No commits in common. "9333ab7a38b5c9204e7ca3ff2b0324cdea28fcd7" and "9cd5e798d91bfb5ffe9665894421e22372852f8f" have entirely different histories.

2 changed files with 4 additions and 4 deletions

4
dist/index.js vendored
View File

@ -123,11 +123,11 @@ class DHTFlood extends events_1.default {
const { id, messageNumber } = this;
let topicString = this.topic.toString("hex");
let peers = [...this.swarm.peers.values()]
.filter((peerInfo) => peerInfo._seenTopics.has(topicString))
.filter((peerInfo) => peerInfo.topics.includes(topicString))
.map((peerInfo) => peerInfo.publicKey);
for (const peer of peers) {
const conn = this.swarm._allConnections.get(peer);
if (!conn) {
if (conn) {
continue;
}
const message = this.setupPeer(conn);

View File

@ -162,12 +162,12 @@ export default class DHTFlood extends EventEmitter {
let topicString = this.topic.toString("hex");
let peers: Buffer[] = [...this.swarm.peers.values()]
.filter((peerInfo: any) => peerInfo._seenTopics.has(topicString))
.filter((peerInfo: any) => peerInfo.topics.includes(topicString))
.map((peerInfo) => peerInfo.publicKey);
for (const peer of peers) {
const conn = this.swarm._allConnections.get(peer);
if (!conn) {
if (conn) {
continue;
}