Skip to content

Commit 583c635

Browse files
committed
fix oracle interval index 2
1 parent de33a9b commit 583c635

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ain-ocean/src/indexer/oracle.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,11 +581,14 @@ pub fn index_interval_mapper(
581581
.next()
582582
.transpose()?;
583583

584-
if previous.is_none() || block.median_time - aggregated.block.median_time > interval as i64 {
584+
if previous.is_none() {
585585
return start_new_bucket(services, block, token, currency, aggregated, interval);
586586
};
587587

588588
if let Some(previous) = previous {
589+
if block.median_time - previous.1.block.median_time > interval as i64 {
590+
return start_new_bucket(services, block, token, currency, aggregated, interval);
591+
};
589592
forward_aggregate(services, previous, aggregated)?;
590593
};
591594

0 commit comments

Comments
 (0)