Skip to content

Commit

Permalink
return empty update if it's too old
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkouv committed Oct 13, 2023
1 parent b374a15 commit 3221121
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/services/ocr2/plugins/ccip/commit_reporting_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ func (r *CommitReportingPlugin) getLatestGasPriceUpdate(ctx context.Context, now
}
}

// if it's too old return an empty update
if gasUpdate.timestamp.Before(now.Add(-r.offchainConfig.GasPriceHeartBeat)) {
return update{}, nil
}
r.lggr.Infow("Latest gas price from log poller", "gasPriceUpdateVal", gasUpdate.value, "gasPriceUpdateTs", gasUpdate.timestamp)
return gasUpdate, nil
}
Expand Down

0 comments on commit 3221121

Please sign in to comment.