Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oracle-core"
version = "2.0.1"
version = "2.0.5"
authors = [
"Robert Kornacki <11645932+robkorn@users.noreply.github.com>",
"@greenhat",
Expand Down
10 changes: 4 additions & 6 deletions core/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ pub fn process(
if let Some(local_datapoint_box_state) = live_epoch.local_datapoint_box_state {
match local_datapoint_box_state {
Collected { height: _ } => {
// publish datapoint after some blocks have passed after the pool box published
// to avoid some oracle box become stale on the next refresh
// (datapoint posted on the first block of the epoch go out of the epoch window too fast)
if current_height.0
> live_epoch.latest_pool_box_height.0 + (epoch_length.0 as u32) / 2
{
// publish datapoint in the second part of the epoch
// to avoid some oracle boxes becoming stale on next refresh
// (datapoint posted on the first block of the epoch goes out of the epoch window too fast)
if (current_height.0 - live_epoch.latest_pool_box_height.0) % epoch_length.0 as u32 > (epoch_length.0 as u32) / 2 {
Some(PoolCommand::PublishSubsequentDataPoint { republish: false })
} else {
None
Expand Down
Loading