mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-25 11:55:53 +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();
|
.collect();
|
||||||
|
|
||||||
let unlock_time = match prefix.additional_timelock {
|
let unlock_time = match prefix.additional_timelock {
|
||||||
transaction::Timelock::None => height,
|
transaction::Timelock::None => 0,
|
||||||
transaction::Timelock::Block(height_lock) => height + usize_to_u64(height_lock),
|
transaction::Timelock::Block(x) => usize_to_u64(x),
|
||||||
transaction::Timelock::Time(seconds) => {
|
transaction::Timelock::Time(x) => x,
|
||||||
height + (seconds / usize_to_u64(monero_serai::BLOCK_TIME))
|
};
|
||||||
}
|
|
||||||
} + usize_to_u64(monero_serai::DEFAULT_LOCK_WINDOW);
|
|
||||||
|
|
||||||
Ok(MinerTransactionPrefix {
|
Ok(MinerTransactionPrefix {
|
||||||
version,
|
version,
|
||||||
|
|
|
@ -106,12 +106,10 @@ impl From<transaction::Transaction> for Transaction {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let unlock_time = match prefix.additional_timelock {
|
let unlock_time = match prefix.additional_timelock {
|
||||||
transaction::Timelock::None => height,
|
transaction::Timelock::None => 0,
|
||||||
transaction::Timelock::Block(height_lock) => height + usize_to_u64(height_lock),
|
transaction::Timelock::Block(x) => usize_to_u64(x),
|
||||||
transaction::Timelock::Time(seconds) => {
|
transaction::Timelock::Time(x) => x,
|
||||||
height + (seconds / usize_to_u64(monero_serai::BLOCK_TIME))
|
};
|
||||||
}
|
|
||||||
} + usize_to_u64(monero_serai::DEFAULT_LOCK_WINDOW);
|
|
||||||
|
|
||||||
TransactionPrefix {
|
TransactionPrefix {
|
||||||
version,
|
version,
|
||||||
|
|
Loading…
Reference in a new issue