From d118020f422739d3472c503f464a176a529c4691 Mon Sep 17 00:00:00 2001 From: Sam Calder-Mason Date: Fri, 29 Sep 2023 12:17:08 +1000 Subject: [PATCH] fix(cannon): Prevent checkpoint iterators going beyond head of chain --- pkg/cannon/iterator/checkpoint_iterator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cannon/iterator/checkpoint_iterator.go b/pkg/cannon/iterator/checkpoint_iterator.go index 231ec83e..c775275f 100644 --- a/pkg/cannon/iterator/checkpoint_iterator.go +++ b/pkg/cannon/iterator/checkpoint_iterator.go @@ -82,7 +82,7 @@ func (c *CheckpointIterator) Next(ctx context.Context) (next *xatu.CannonLocatio c.metrics.SetTrailingEpochs(c.cannonType.String(), c.networkName, c.checkpointName, float64(checkpoint.Epoch-locationEpoch)) - if locationEpoch == checkpoint.Epoch { + if locationEpoch >= checkpoint.Epoch { // Sleep until the next epoch epoch := c.wallclock.Epochs().Current()