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

Commit

Permalink
create option to skip S Value check
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderer committed Jan 6, 2016
1 parent 70db234 commit d78f974
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Transaction.prototype.verifySignature = function () {
var msgHash = this.hash(false)

// All transaction signatures whose s-value is greater than secp256k1n/2 are considered invalid.
if (new BN(this.s).cmp(N_DIV_2) === 1) {
if (!this._skipSValueCheck && new BN(this.s).cmp(N_DIV_2) === 1) {
return false
}

Expand Down
3 changes: 3 additions & 0 deletions test/transactionRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ testing.runTests(function (testData, sst, cb) {

try {
var tx = new Tx(new Buffer(testData.rlp.slice(2), 'hex'))
if (testData.blocknumber !== '900000') {
tx._skipSValueCheck = true
}
} catch (e) {
sst.equal(undefined, tTx, 'should not have any fields ')
cb()
Expand Down

0 comments on commit d78f974

Please sign in to comment.