Skip to content

Commit

Permalink
fix oracle interval index
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Dec 16, 2024
1 parent 29246ff commit de33a9b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/ain-ocean/src/indexer/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,16 +581,14 @@ pub fn index_interval_mapper(
.next()
.transpose()?;

let Some(previous) = previous else {
if previous.is_none() || block.median_time - aggregated.block.median_time > interval as i64 {
return start_new_bucket(services, block, token, currency, aggregated, interval);
};

if block.median_time - aggregated.block.median_time > interval as i64 {
return start_new_bucket(services, block, token, currency, aggregated, interval);
if let Some(previous) = previous {
forward_aggregate(services, previous, aggregated)?;
};

forward_aggregate(services, previous, aggregated)?;

Ok(())
}

Expand Down

0 comments on commit de33a9b

Please sign in to comment.