File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,11 +34,12 @@ pub fn process(
3434 if let Some ( local_datapoint_box_state) = live_epoch. local_datapoint_box_state {
3535 match local_datapoint_box_state {
3636 Collected { height : _ } => {
37- // publish datapoint after some blocks have passed after the pool box published
38- // to avoid some oracle box become stale on the next refresh
39- // (datapoint posted on the first block of the epoch go out of the epoch window too fast)
40- if current_height. 0
41- > live_epoch. latest_pool_box_height . 0 + ( epoch_length. 0 as u32 ) / 2
37+ // publish datapoint in the second part of the epoch
38+ // to avoid some oracle boxes becoming stale on next refresh
39+ // (datapoint posted on the first block of the epoch goes out of the epoch window too fast)
40+ if ( current_height. 0 - live_epoch. latest_pool_box_height . 0 )
41+ % epoch_length. 0 as u32
42+ > ( epoch_length. 0 as u32 ) / 2
4243 {
4344 Some ( PoolCommand :: PublishSubsequentDataPoint { republish : false } )
4445 } else {
You can’t perform that action at this time.
0 commit comments