Skip to content

Commit d4682c6

Browse files
committed
add comment
1 parent c630caf commit d4682c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

program/c/src/oracle/upd_aggregate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ static inline bool upd_aggregate( pc_price_t *ptr, uint64_t slot, int64_t timest
175175
// No overflow for INT64_MIN+conf or INT64_MAX-conf as 0 < conf < INT64_MAX
176176
// These checks ensure that price - conf and price + conf do not overflow.
177177
(int64_t)0 < conf && (INT64_MIN + conf) <= price && price <= (INT64_MAX-conf) &&
178+
// slot_diff is implicitly >= 0 due to the check in Rust code ensuring publishing_slot is always less than or equal to the current slot.
178179
slot_diff <= (ptr->max_latency_ ? ptr->max_latency_ : PC_MAX_SEND_LATENCY) ) {
179180
numv += 1;
180181
prcs[ nprcs++ ] = price - conf;

0 commit comments

Comments
 (0)