Skip to content

Commit

Permalink
Don't persist signature until after verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Smith authored and Stacie Waleyko committed Apr 29, 2021
1 parent 79ae7bf commit 5823317
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/primitives/mtx.js
Expand Up @@ -721,12 +721,12 @@ class MTX extends TX {

result.push(redeem);

vector.fromStack(result);

if (preSig && this.checksig(index, prev, value, sig, ring.publicKey, version) === false) {
throw new Error('Invalid signature.');
}

vector.fromStack(result);

return true;
}

Expand All @@ -736,12 +736,12 @@ class MTX extends TX {
if (!result)
return false;

vector.fromStack(result);

if (preSig && this.checksig(index, prev, value, sig, ring.publicKey, version) === false) {
throw new Error('Invalid signature.');
}

vector.fromStack(result);

return true;
}

Expand Down

0 comments on commit 5823317

Please sign in to comment.