Merge pull request #188 from quorumcontrol/heartbeat-race
Fix gossipsub race condition for heartbeat
This commit is contained in:
commit
4221a3966b
|
@ -231,7 +231,7 @@ func (gs *GossipSubRouter) Publish(from peer.ID, msg *pb.Message) {
|
||||||
if !ok {
|
if !ok {
|
||||||
// we are not in the mesh for topic, use fanout peers
|
// we are not in the mesh for topic, use fanout peers
|
||||||
gmap, ok = gs.fanout[topic]
|
gmap, ok = gs.fanout[topic]
|
||||||
if !ok {
|
if !ok || len(gmap) == 0 {
|
||||||
// we don't have any, pick some
|
// we don't have any, pick some
|
||||||
peers := gs.getPeers(topic, GossipSubD, func(peer.ID) bool { return true })
|
peers := gs.getPeers(topic, GossipSubD, func(peer.ID) bool { return true })
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue