Skip to content
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

fix Signature.prototype.hasDefinedHashtype #22

Closed
wants to merge 3 commits into from

Conversation

niahmiah
Copy link
Contributor

@niahmiah niahmiah commented Oct 7, 2017

While investigating issues with bch-channel tests, ran into this. Seems wrong. Let's discuss.

@niahmiah niahmiah requested a review from ajp8164 October 7, 2017 21:54
Copy link

@ajp8164 ajp8164 left a comment

Choose a reason for hiding this comment

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

Looks good. I assume this does fix the tests.

@coveralls
Copy link

coveralls commented Nov 3, 2017

Coverage Status

Coverage increased (+0.0004%) to 97.244% when pulling 0934cda on hasDefinedHashTypeFix into 4c895d8 on master.

@@ -293,7 +293,11 @@ Signature.prototype.hasDefinedHashtype = function() {
}
// accept with or without Signature.SIGHASH_ANYONECANPAY by ignoring the bit
var temp = this.nhashtype & ~Signature.SIGHASH_ANYONECANPAY;
if (temp < (Signature.SIGHASH_ALL|Signature.SIGHASH_FORKID) || temp > (Signature.SIGHASH_SINGLE|Signature.SIGHASH_FORKID)) {

// accept with or without Signature.SIGHASH_FORKID by ignoring it too
Copy link

@ajp8164 ajp8164 Nov 6, 2017

Choose a reason for hiding this comment

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

Why does this bit have to be ignored? Wouldn't FORKID necessarily be present all the time?

@niahmiah
Copy link
Contributor Author

niahmiah commented Nov 6, 2017

closing after discussion

@niahmiah niahmiah closed this Nov 6, 2017
@niahmiah niahmiah deleted the hasDefinedHashTypeFix branch November 7, 2017 23:41
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.

None yet

3 participants