From a6d30f09d1cd04fb66531e6642b698a614ebaa1a Mon Sep 17 00:00:00 2001 From: Cayman Date: Wed, 1 Jul 2020 19:01:48 -0500 Subject: [PATCH] chore: use publish threshold for floodsub peers --- ts/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts/index.ts b/ts/index.ts index 94c69d31..7fd815c1 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -765,7 +765,8 @@ class Gossipsub extends BasicPubsub { // floodsub peers peersInTopic.forEach((peer) => { - if (peer.protocols.includes(constants.FloodsubID)) { + const score = this.score.score(peer.id.toB58String()) + if (peer.protocols.includes(constants.FloodsubID) && score >= this._options.scoreThresholds.publishThreshold) { tosend.add(peer) } })