-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix SequenceNumber for nLockTime transactions #1324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ransaction with an nLocktime must be not the standard max value. We set the sequence number of 0 if the value is max. Currently sequence numbers other than MAX_INT32 have no meaning in the Bitcoin protocol but this may change in future BIPS
LGTM, with a few thoughts:
|
I don't entirely follow your second bullet point? |
Something like this in the second two tests: var copy = new Transaction(serialized_tx);
copy.inputs[0].sequenceNumber.should.equal(Transaction.Input.DEFAULT_LOCKTIME_SEQNUMBER) |
Test that the SequenceNumber is zero Remove unncessary expect
My objection to having that test is that this test case doesn't actually that a transaction correctly follows the Bitcoin specifications. It merely handshakes that the code works as currently written. As I've written the test now, the system tests that a transaction does not have a sequence number that would invalidate the effect of locktime. But anyway I modified the test cases as requested. |
Sorry, I think there may be some confusion here. The test case that I was thinking should be covered is that "sequenceNumber" is the correct property (which it is), and that when the object is serialized, the property isn't lost, such as would be if the property set was "sequence" instead. |
Ah I get it |
ACK |
Fix SequenceNumber for nLockTime transactions
Great work @zmanian! |
Landed in release 0.13.2 |
To be effective within the current Bitcoin network, the inputs to a transaction with an nLocktime must be not the standard max value.We set the sequence number of 0 if the value is max.Currently sequence numbers other than MAX_INT32 have no meaning in the Bitcoin protoco but this may change in future BIPS