avoiding back in time travel
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
This commit is contained in:
parent
b969081cbf
commit
1c4c517728
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ghost-slow-clap"
|
name = "ghost-slow-clap"
|
||||||
version = "0.3.38"
|
version = "0.3.39"
|
||||||
description = "Applause protocol for the EVM bridge"
|
description = "Applause protocol for the EVM bridge"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
@ -763,23 +763,20 @@ impl<T: Config> Pallet<T> {
|
|||||||
|
|
||||||
Ok(match maybe_block_range {
|
Ok(match maybe_block_range {
|
||||||
Some((from_block, to_block)) => match maybe_new_evm_block {
|
Some((from_block, to_block)) => match maybe_new_evm_block {
|
||||||
Some(_) => {
|
Some(_) if from_block.le(&to_block) => {
|
||||||
match estimated_block.checked_sub(from_block) {
|
let adjusted_to_block = estimated_block
|
||||||
Some(current_distance)
|
.checked_sub(from_block)
|
||||||
if current_distance
|
.map(|current_distance| current_distance
|
||||||
< max_block_distance =>
|
.le(&max_block_distance)
|
||||||
{
|
.then(|| estimated_block)
|
||||||
(from_block, estimated_block)
|
)
|
||||||
}
|
.flatten()
|
||||||
_ => (
|
.unwrap_or(from_block
|
||||||
from_block,
|
|
||||||
from_block
|
|
||||||
.saturating_add(max_block_distance)
|
.saturating_add(max_block_distance)
|
||||||
.min(estimated_block),
|
.min(estimated_block));
|
||||||
),
|
(from_block, adjusted_to_block)
|
||||||
}
|
}
|
||||||
}
|
_ => (to_block, to_block),
|
||||||
None => (to_block, to_block),
|
|
||||||
},
|
},
|
||||||
None => (estimated_block, estimated_block),
|
None => (estimated_block, estimated_block),
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user