Skip to content

Conversation

zmanian
Copy link
Contributor

@zmanian zmanian commented Aug 14, 2015

This sets all input sequence numbers to a non max value on setting a locktime

Proposal to fix #1315

This sets all input sequence numbers to a non max value on setting a locktime
@maraoz
Copy link
Contributor

maraoz commented Aug 14, 2015

why not set them to 0 instead of 0xFFFFFFF0?

This sets all input sequence numbers to a non max value on setting a locktime
@zmanian
Copy link
Contributor Author

zmanian commented Aug 14, 2015

Updated...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things:

  • This may not serialize because I think the property for the sequence number on an input is .sequenceNumber.
  • There should be tests to cover these statements
  • Indentation is incorrect (should be two spaces, as similar to the statements above)

@zmanian
Copy link
Contributor Author

zmanian commented Aug 21, 2015

Yep I'll write up the test cases and update. Thanks!

@zmanian
Copy link
Contributor Author

zmanian commented Aug 24, 2015

Just FYI,

Transaction 224660f2196fd22becb54f7c69f7a0ca07526e456276ef9f000c31a783275ab8 on testnet has 0 sequence number and was created with a locktime. Appears to be a correct tx.

Working on test cases for the pull request

Braydon Fuller and others added 8 commits August 24, 2015 16:34
- Restores InvalidIndexCantDeriveHardened error in spec
- Passes hardened argument in HDPublicKey (in case the feature is attempted to be used similarly to HDPrivateKey)
- Fixes undefined error with InvalidLength
- Fixes tests to check for the error type
- Various formatting cleanup improvements
bitcore should be able to run inside a web worker. There were two minor issues
preventing bitcore from running inside a web worker. The first was that lodash
was outdated, and that version of lodash had a problem with web workers. The
second was that the wrong version of ripemd160 was being called, because
global.window does not exist inside a web worker (global.self does instead). A
better way to check if you are in a browser is with process.browser.
@zmanian
Copy link
Contributor Author

zmanian commented Aug 24, 2015

updates with tests

@braydonf
Copy link
Contributor

Please make sure to rebase on master (git rebase master), this should clean up the commits and the diff.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using only should I think will work here (and the others), e.g.:

transaction.inputs[0].sequenceNumber.should.not.equal(Transaction.Input.DEFAULT_SEQNUMBER);

@zmanian zmanian closed this Aug 25, 2015
@zmanian zmanian deleted the SetLockTimeSeqNumber branch August 25, 2015 01:49
@zmanian
Copy link
Contributor Author

zmanian commented Aug 25, 2015

I'm just going to open a cleaner commit on a new pull request.

From correctness for the current Bitcoin protocol point of view, any non max sequence number would be correct.

When/if CHECKSEQUENCEVERIFY gets implemented, any non-max field should be accepted in the field.

@zmanian
Copy link
Contributor Author

zmanian commented Aug 25, 2015

#1324 is a cleaner commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correct Sequence Number for lockTime transactions
4 participants