Skip to content

Commit

Permalink
fix: check if spending condition has too many sigs
Browse files Browse the repository at this point in the history
  • Loading branch information
reedrosenbluth committed Sep 2, 2021
1 parent 8ae3f34 commit 6ad03fd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/transactions/src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export class TransactionSigner {
// auth fields and reconstruct sigHash
let spendingCondition = transaction.auth.spendingCondition;
if (spendingCondition && !isSingleSig(spendingCondition)) {

if (spendingCondition.fields.length >= spendingCondition.signaturesRequired) {
throw new Error('SpendingCondition has more signatures than are expected');
}

spendingCondition.fields.forEach(field => {
if (field.contents.type === StacksMessageType.MessageSignature) {
if (!transaction.auth.authType) {
Expand Down

0 comments on commit 6ad03fd

Please sign in to comment.