From 5ff9821c4843c44fd3292d4d7fc0ee82156a124f Mon Sep 17 00:00:00 2001 From: "Dr. Maxim Orlovsky" Date: Tue, 15 Oct 2024 12:16:56 +0200 Subject: [PATCH] vm: fix checks for the blocktime window in consensus ordering Co-authored-by: Stefano Pellegrini <33753050+St333p@users.noreply.github.com> --- src/vm/contract.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vm/contract.rs b/src/vm/contract.rs index 633c3492..e0d5534f 100644 --- a/src/vm/contract.rs +++ b/src/vm/contract.rs @@ -375,12 +375,12 @@ impl Ord for WitnessPos { match (self.layer1, other.layer1) { (a, b) if a == b => self.height.cmp(&other.height), (Layer1::Bitcoin, Layer1::Liquid) - if (self.timestamp - other.timestamp).abs() >= BLOCK_TIME => + if (self.timestamp - other.timestamp).abs() < BLOCK_TIME => { Ordering::Greater } (Layer1::Liquid, Layer1::Bitcoin) - if (other.timestamp - self.timestamp).abs() >= BLOCK_TIME => + if (other.timestamp - self.timestamp).abs() < BLOCK_TIME => { Ordering::Less }