Skip to content

Commit

Permalink
CCIP-1147 - Update cache only with most recent data
Browse files Browse the repository at this point in the history
  • Loading branch information
jarnaud committed Oct 12, 2023
1 parent ce09bc0 commit c7c6b8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/services/ocr2/plugins/ccip/price_updates_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ func (c *priceUpdatesCache) get() update {
}

func (c *priceUpdatesCache) updateCache(update update) {
c.lastUpdate = update
if update.timestamp.After(c.lastUpdate.timestamp) {
c.lastUpdate = update
}
}

0 comments on commit c7c6b8a

Please sign in to comment.