diff --git a/node/consensus/data/consensus_frames.go b/node/consensus/data/consensus_frames.go index 60d303e..969145d 100644 --- a/node/consensus/data/consensus_frames.go +++ b/node/consensus/data/consensus_frames.go @@ -302,11 +302,11 @@ func (e *DataClockConsensusEngine) sync( } func (e *DataClockConsensusEngine) collect( - currentFramePublished *protobufs.ClockFrame, + enqueuedFrame *protobufs.ClockFrame, ) (*protobufs.ClockFrame, error) { e.logger.Info("collecting vdf proofs") - latest := currentFramePublished + latest := enqueuedFrame for { peerId, maxFrame, err := e.GetMostAheadPeer(latest.FrameNumber) diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index 9ae4f65..f79ea6a 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -330,7 +330,8 @@ func (e *DataClockConsensusEngine) Start() <-chan error { panic(err) } - if frame.FrameNumber >= nextFrame.FrameNumber || frame.FrameNumber == 0 { + if frame.FrameNumber >= nextFrame.FrameNumber || + nextFrame.FrameNumber == 0 { time.Sleep(30 * time.Second) continue } diff --git a/node/consensus/time/data_time_reel.go b/node/consensus/time/data_time_reel.go index 7b0cb0a..6324a11 100644 --- a/node/consensus/time/data_time_reel.go +++ b/node/consensus/time/data_time_reel.go @@ -606,7 +606,10 @@ func (d *DataTimeReel) setHead(frame *protobufs.ClockFrame, distance *big.Int) { d.headDistance = distance go func() { - d.newFrameCh <- frame + select { + case d.newFrameCh <- frame: + default: + } }() } @@ -906,7 +909,10 @@ func (d *DataTimeReel) forkChoice( ) go func() { - d.newFrameCh <- frame + select { + case d.newFrameCh <- frame: + default: + } }() }