bitcoind IsFinalTx() as seen here checks the properties of a transaction in this order:
- Is
nLockTimeexactly0? That's final. return. - If it's not
0, is it below the current block height / time? If so, it's final. return. - Ensure that every tx input is exactly
0xffffffff. If so, it's final.
Because these are checked in order with return statements, nSequence won't even be checked if nLockTime == 0. Furthermore, a transaction that is NOT past its nLockTime value could still be "final" as long as all the nSequence values are 0xffffffff
Non-final transactions are not valid in blocks, so my questions are:
Why is a "bad" locktime ok as long as all sequences are final? The tx won't be mineable anyway, right?
What are the implications for replace-by-fee and Check Sequence Verify transactions (when a non-final
nSequencevalue is used)? Does this mean that to use those features,nLockTimehas to be set a certain way?Or, maybe, because
nLockTimehas to be below the current time/height anyway, this is all just moot and really,nSequencedoesn't really impact transaction finality at all.