Skip to content

Commit 4221a39

Browse files
authored
Merge pull request #188 from quorumcontrol/heartbeat-race
Fix gossipsub race condition for heartbeat
2 parents 49274b0 + 5e883d7 commit 4221a39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gossipsub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func (gs *GossipSubRouter) Publish(from peer.ID, msg *pb.Message) {
231231
if !ok {
232232
// we are not in the mesh for topic, use fanout peers
233233
gmap, ok = gs.fanout[topic]
234-
if !ok {
234+
if !ok || len(gmap) == 0 {
235235
// we don't have any, pick some
236236
peers := gs.getPeers(topic, GossipSubD, func(peer.ID) bool { return true })
237237

0 commit comments

Comments
 (0)