mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-07-30 20:11:23 +00:00
Fixed bug with sequence
This commit is contained in:
@@ -195,15 +195,19 @@ impl TransparentInputs {
|
|||||||
// _ => return Err(Error::InvalidAddress),
|
// _ => return Err(Error::InvalidAddress),
|
||||||
// }
|
// }
|
||||||
|
|
||||||
mtx.vin.push(TxIn::new(utxo));
|
let txin = TxIn::new(utxo);
|
||||||
self.inputs.push(TransparentInputInfo { sk, pubkey, coin, secret, redeem_script });
|
|
||||||
|
|
||||||
// Set lock time if present
|
// Set lock time if present
|
||||||
if (lock_time > 0) {
|
if (lock_time > 0) {
|
||||||
mtx.sequence = 4294967294; // max value (0xFFFFFFFF - 1), so lockTime can be used but not RBF
|
|
||||||
mtx.lock_time = lock_time;
|
mtx.lock_time = lock_time;
|
||||||
|
|
||||||
|
// Also set sequence
|
||||||
|
txin.sequence = std::u32::MAX - 1; // max value (0xFFFFFFFF - 1), so lockTime can be used but not RBF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mtx.vin.push(txin);
|
||||||
|
self.inputs.push(TransparentInputInfo { sk, pubkey, coin, secret, redeem_script });
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user