Skip to content

Commit

Permalink
start with existing gas price update to prevent empty result
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkouv committed Oct 13, 2023
1 parent ce34089 commit b374a15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/services/ocr2/plugins/ccip/commit_reporting_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ func (r *CommitReportingPlugin) getLatestTokenPriceUpdates(ctx context.Context,
// getLatestGasPriceUpdate returns the latest gas price update based on logs within the heartbeat.
// If an update is found, it is not expected to contain a nil value. If no updates found, empty update with nil value is returned.
func (r *CommitReportingPlugin) getLatestGasPriceUpdate(ctx context.Context, now time.Time, checkInflight bool) (gasUpdate update, error error) {
gasUpdate = r.priceUpdatesCache.getGasPriceUpdate()

if checkInflight {
latestInflightGasPriceUpdates := r.inflightReports.latestInflightGasPriceUpdates()
if inflightUpdate, exists := latestInflightGasPriceUpdates[r.sourceChainSelector]; exists {
Expand Down

0 comments on commit b374a15

Please sign in to comment.