mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-10 12:54:44 +00:00
fix tx timelock
This commit is contained in:
parent
7660532840
commit
cc078b693b
2 changed files with 8 additions and 12 deletions
|
@ -117,12 +117,10 @@ impl TryFrom<transaction::Transaction> 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,
|
||||
|
|
|
@ -106,12 +106,10 @@ impl From<transaction::Transaction> 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,
|
||||
|
|
Loading…
Reference in a new issue