Skip to content

Commit 951b4f0

Browse files
committed
Use correct parameter call order
We are passing `csv` and `cltv` variables to `from_txdata` in the wrong order. While we are at it, add code comments linking age/csv and height/cltv.
1 parent ea76eb1 commit 951b4f0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/interpreter/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ impl<'txin> Interpreter<'txin> {
169169
spk: &bitcoin::Script,
170170
script_sig: &'txin bitcoin::Script,
171171
witness: &'txin Witness,
172-
age: u32,
173-
height: u32,
172+
age: u32, // CSV, relative lock time.
173+
height: u32, // CLTV, absolute lock time.
174174
) -> Result<Self, Error> {
175175
let (inner, stack, script_code) = inner::from_txdata(spk, script_sig, witness)?;
176176
Ok(Interpreter {

src/psbt/finalizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ fn interpreter_inp_check<C: secp256k1::Verification, T: Borrow<TxOut>>(
295295
let cltv = psbt.unsigned_tx.lock_time;
296296
let csv = psbt.unsigned_tx.input[index].sequence;
297297
let interpreter =
298-
interpreter::Interpreter::from_txdata(spk, script_sig, witness, cltv, csv)
298+
interpreter::Interpreter::from_txdata(spk, script_sig, witness, csv, cltv)
299299
.map_err(|e| Error::InputError(InputError::Interpreter(e), index))?;
300300
let iter = interpreter.iter(secp, &psbt.unsigned_tx, index, utxos);
301301
if let Some(error) = iter.filter_map(Result::err).next() {

0 commit comments

Comments
 (0)