Compare commits
3 Commits
9cd5e798d9
...
9333ab7a38
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 9333ab7a38 | |
Derrick Hammer | 0a335997bf | |
Derrick Hammer | 9b2e04ae3c |
|
@ -123,11 +123,11 @@ class DHTFlood extends events_1.default {
|
||||||
const { id, messageNumber } = this;
|
const { id, messageNumber } = this;
|
||||||
let topicString = this.topic.toString("hex");
|
let topicString = this.topic.toString("hex");
|
||||||
let peers = [...this.swarm.peers.values()]
|
let peers = [...this.swarm.peers.values()]
|
||||||
.filter((peerInfo) => peerInfo.topics.includes(topicString))
|
.filter((peerInfo) => peerInfo._seenTopics.has(topicString))
|
||||||
.map((peerInfo) => peerInfo.publicKey);
|
.map((peerInfo) => peerInfo.publicKey);
|
||||||
for (const peer of peers) {
|
for (const peer of peers) {
|
||||||
const conn = this.swarm._allConnections.get(peer);
|
const conn = this.swarm._allConnections.get(peer);
|
||||||
if (conn) {
|
if (!conn) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const message = this.setupPeer(conn);
|
const message = this.setupPeer(conn);
|
||||||
|
|
|
@ -162,12 +162,12 @@ export default class DHTFlood extends EventEmitter {
|
||||||
let topicString = this.topic.toString("hex");
|
let topicString = this.topic.toString("hex");
|
||||||
|
|
||||||
let peers: Buffer[] = [...this.swarm.peers.values()]
|
let peers: Buffer[] = [...this.swarm.peers.values()]
|
||||||
.filter((peerInfo: any) => peerInfo.topics.includes(topicString))
|
.filter((peerInfo: any) => peerInfo._seenTopics.has(topicString))
|
||||||
.map((peerInfo) => peerInfo.publicKey);
|
.map((peerInfo) => peerInfo.publicKey);
|
||||||
|
|
||||||
for (const peer of peers) {
|
for (const peer of peers) {
|
||||||
const conn = this.swarm._allConnections.get(peer);
|
const conn = this.swarm._allConnections.get(peer);
|
||||||
if (conn) {
|
if (!conn) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue