7
2
I've noticed recently that Bitcoin Core is producing transactions with non-zero lock-time and sequence numbers of inputs being 0xFFFFFFFE, even though I didn't instruct it to do so. The lock-time appears to be current block number.
- What is the reason for this behavior?
- What is the algorithm for setting sequence number?
(I know that at least one input must have sequence number less than 0xFFFFFFFF. Does the Core set just first input or all inputs? I couldn't check this because I have no transaction with more than one input.)
Thank you for your answers!
1
Seems like sequence is set to max()-1 for every input. The code is just bellow of what you mentioned Thank you for your answer!
– Martin Habovštiak – 2016-09-03T09:04:04.8501Do you have a text version of the explanation? The code you posted is really unreadable on mobile, because you need to scroll to the right for every line – Ferrybig – 2016-09-09T05:53:21.927
@Ferrybig: I've put the TL;DR at the top. – Murch – 2016-09-09T12:37:41.650
is there a reason for that weird sequence number? the reasons stated in this answer only seem to explain the nLockTime, not the sequence number – knocte – 2017-11-07T08:10:52.780
1@knocte:
nLockTimeis only active if the sequence number is belowUINT_MAX. – Murch – 2017-11-09T06:45:48.727