Skip to content

Commit

Permalink
L-06 [Oval] CoinbaseSourceAdapter May Return Old Prices (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
  • Loading branch information
Reinis-FRP committed Jun 18, 2024
1 parent 77e5441 commit 70e5b66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/adapters/source-adapters/CoinbaseSourceAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ abstract contract CoinbaseSourceAdapter is DiamondRootOval {
// Attempt traversing historical round data backwards from roundId.
(int256 historicalAnswer, uint256 historicalUpdatedAt) = _searchRoundDataAt(timestamp, roundId, maxTraversal);

// Validate returned data. If it is uninitialized, fall back to returning the current latest round data.
if (historicalUpdatedAt > 0) {
// Validate returned data. If it is uninitialized or too old, fall back to returning the current latest round data.
if (historicalUpdatedAt > block.timestamp - maxAge()) {
return (historicalAnswer, historicalUpdatedAt);
}

Expand Down

0 comments on commit 70e5b66

Please sign in to comment.