Skip to content

Commit

Permalink
fix: give preference to the snapshot data for same timestamp
Browse files Browse the repository at this point in the history
Signed-off-by: Reinis Martinsons <[email protected]>
  • Loading branch information
Reinis-FRP committed May 20, 2024
1 parent 77b162c commit d425284
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/adapters/source-adapters/BoundedUnionSourceAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ abstract contract BoundedUnionSourceAdapter is
(boundedAnswer, boundedTimestamp) = _selectBoundedPrice(data);

// Return bounded data unless there is a newer snapshotted data that still satisfies time constraint.
if (boundedTimestamp >= snapshot.timestamp || snapshot.timestamp > timestamp) {
if (boundedTimestamp > snapshot.timestamp || snapshot.timestamp > timestamp) {
return (boundedAnswer, boundedTimestamp, 1);
}
return (snapshot.answer, snapshot.timestamp, 1);
Expand Down

0 comments on commit d425284

Please sign in to comment.