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.
This commit is contained in:
parent
e8c5cf0914
commit
ef730627ad
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user