We now support spending from coins containing CHECKLOCKTIMEVERIFY
instructions. CLTV
is a check on the value of the nLockTime
field of the spending transaction. There are two types of timelocks possible: by timestamp and by block. Both are incompatible, the nLockTime
field cannot satisfy both a timestamp and a block timelock.
The coin selection is at the moment completely unaware of timelocks. If we have two coins for two different descriptors, one with a timestamp absolute timelock and the other with a block count absolute timelock, the coin selection algorithm may select both of them in a single transaction.
To be clear i don’t think this should be treated as a bug that needs resolving for 25.0. As mentioned in #24149 the wallet needs a lot more logic to correctly handle managing coins with more complex scripts. (For instance, the wallet doesn’t know what timelocked coins would be spendable at the next block, let alone set the nSequence
, nLockTime
according to the required value.)
From a conversation with @sanket1729. Also cc @ishaanam.