From ee1ebcce807e824b28e5911d5e1ad0221a72d99f Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Sat, 9 Mar 2024 20:54:00 -0600 Subject: [PATCH] fix: silence in the master library --- node/consensus/master/broadcast_messaging.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/node/consensus/master/broadcast_messaging.go b/node/consensus/master/broadcast_messaging.go index 3c93631..e497ccc 100644 --- a/node/consensus/master/broadcast_messaging.go +++ b/node/consensus/master/broadcast_messaging.go @@ -300,11 +300,16 @@ func (e *MasterClockConsensusEngine) publishProof( e.masterTimeReel.Insert(frame) - if err := e.publishMessage(e.filter, frame); err != nil { - return errors.Wrap( - err, - "publish proof", - ) + peers, err := e.GetMostAheadPeers() + if err != nil || len(peers) == 0 { + // publish if we don't see anyone (empty peer list) or if we're the most + // ahead: + if err := e.publishMessage(e.filter, frame); err != nil { + return errors.Wrap( + err, + "publish proof", + ) + } } e.state = consensus.EngineStateCollecting