From cc078b693b23fa9aa994284b400d2f99c52e7d20 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Mon, 30 Sep 2024 16:21:02 -0400 Subject: [PATCH] fix tx timelock --- types/src/json/block.rs | 10 ++++------ types/src/json/tx.rs | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/types/src/json/block.rs b/types/src/json/block.rs index 2926b6d..57b33a2 100644 --- a/types/src/json/block.rs +++ b/types/src/json/block.rs @@ -117,12 +117,10 @@ impl TryFrom for MinerTransaction { .collect(); let unlock_time = match prefix.additional_timelock { - transaction::Timelock::None => height, - transaction::Timelock::Block(height_lock) => height + usize_to_u64(height_lock), - transaction::Timelock::Time(seconds) => { - height + (seconds / usize_to_u64(monero_serai::BLOCK_TIME)) - } - } + usize_to_u64(monero_serai::DEFAULT_LOCK_WINDOW); + transaction::Timelock::None => 0, + transaction::Timelock::Block(x) => usize_to_u64(x), + transaction::Timelock::Time(x) => x, + }; Ok(MinerTransactionPrefix { version, diff --git a/types/src/json/tx.rs b/types/src/json/tx.rs index e396da5..35d2a73 100644 --- a/types/src/json/tx.rs +++ b/types/src/json/tx.rs @@ -106,12 +106,10 @@ impl From for Transaction { .collect(); let unlock_time = match prefix.additional_timelock { - transaction::Timelock::None => height, - transaction::Timelock::Block(height_lock) => height + usize_to_u64(height_lock), - transaction::Timelock::Time(seconds) => { - height + (seconds / usize_to_u64(monero_serai::BLOCK_TIME)) - } - } + usize_to_u64(monero_serai::DEFAULT_LOCK_WINDOW); + transaction::Timelock::None => 0, + transaction::Timelock::Block(x) => usize_to_u64(x), + transaction::Timelock::Time(x) => x, + }; TransactionPrefix { version,