Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

hasLowS validation not using correct constant as it is set in base 10 rather than hex #17

Merged
merged 1 commit into from
Jan 21, 2016

Conversation

edbo
Copy link
Contributor

@edbo edbo commented Nov 10, 2015

I was running this validation on test net and noticed even new transactions I was creating with the latest bitcoin client weren't validating correctly.

I've made the spec tests the boundaries of the low s/high s as well and cleaned it up a little there. Given BP62 is going more mainstream (more nodes running bitcoin 0.11.1 and 0.10.3) this might start to trip people up.

@edbo edbo changed the title Set s mid point as hex rather than decimal (bn.js default) hasLowS validation not using correct constant as it is set in base 10 rather than hex Nov 10, 2015
@fanatid
Copy link
Contributor

fanatid commented Nov 26, 2015

ACK

@braydonf
Copy link
Contributor

LGTM

Looks like the toLowS method uses separate logic:

if (s.gt(BN.fromBuffer(new Buffer('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 'hex')))) {

braydonf added a commit that referenced this pull request Jan 21, 2016
hasLowS validation not using correct constant as it is set in base 10 rather than hex
@braydonf braydonf merged commit 55bb6ad into bitpay:master Jan 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants