Closed educob closed 5 years ago
I made it work by calling
txb.addInput(utxo_tx, utxo_n, bitcoin.Transaction.DEFAULT_SEQUENCE-1)
Without specifying the sequence, the input sequence ends up being 0xffffffff and that means that locktime is ignored.
Unless I am doing something wrong, the test examples are wrong cause they don't specify the 3er argument when calling addInput.
looks like 0xfffffffe to me...
Which test are you talking about?
Now that all is clear I'll close the issue.
The library should modify the inputs sequence when setting tx's locktime or at least should give a warning that tx's locktime is not having any effect. After heavy reading and a lot of of hands on, this setting of the input sequence number is clear but a comment here and there in the examples would've been wonderful.
Thanks.
Hello guys.
Whataever time in the future I set in lockTime the tx is always accepted by the bitcoin node.
Any idea why? As you can in a previous issue adding, OP_CHECKLOCKTIMEVERIFY to a script doesn't work either for me (in the opposite way, always rejecting the tx). Something is wrong with timing. I am running a regtest in my computer. I mine a block every 2 minutes (or manually as many as I want as once). What can be wrong so all the timing restrictions don't work?
Please help me. Thanks.