From ef730627adedd8c55c29f22402256d5326246085 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 21 Feb 2018 19:03:12 +0200 Subject: [PATCH] remove unnecessary and potentially harmful check from heartbeat - the check is unnecessary because peers emit PRUNE on Leave - the check is harmful, because the ANNOUNCE message might have benn lost (or reordered after the GRAFT depending on the retry strategy), which would leave the mesh in an inconsistent state. --- gossipsub.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/gossipsub.go b/gossipsub.go index 6835147..8793977 100644 --- a/gossipsub.go +++ b/gossipsub.go @@ -334,14 +334,6 @@ func (gs *GossipSubRouter) heartbeat() { // maintain the mesh for topics we have joined for topic, peers := range gs.mesh { - // check whether our peers are still in the topic - for p := range peers { - _, ok := gs.p.topics[topic][p] - if !ok { - delete(peers, p) - } - } - // do we have enough peers? if len(peers) < GossipSubDlo { ineed := GossipSubD - len(peers)