Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cjs/payments/p2ms.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function p2ms(a, opts) {
function isAcceptableSignature(x) {
return (
bscript.isCanonicalScriptSignature(x) ||
(opts.allowIncomplete && x === OPS.OP_0) !== undefined
!!(opts.allowIncomplete && x === OPS.OP_0)
);
}
v.parse(
Expand Down
2 changes: 1 addition & 1 deletion src/esm/payments/p2ms.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function p2ms(a, opts) {
function isAcceptableSignature(x) {
return (
bscript.isCanonicalScriptSignature(x) ||
(opts.allowIncomplete && x === OPS.OP_0) !== undefined
!!(opts.allowIncomplete && x === OPS.OP_0)
);
}
v.parse(
Expand Down
11 changes: 11 additions & 0 deletions test/fixtures/p2ms.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,17 @@
"input": "OP_0 ffffffffffffffff"
}
},
{
"description": "Invalid signature rejected even with allowIncomplete",
"exception": "Input has invalid signature\\(s\\)",
"options": {
"allowIncomplete": true
},
"arguments": {
"output": "OP_1 030000000000000000000000000000000000000000000000000000000000000001 OP_1 OP_CHECKMULTISIG",
"input": "OP_0 ffffffffffffffff"
}
},
{
"description": "n > 20 (2-of-21 multisig)",
"exception": "Output is invalid",
Expand Down
2 changes: 1 addition & 1 deletion ts_src/payments/p2ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function p2ms(a: Payment, opts?: PaymentOpts): Payment {
function isAcceptableSignature(x: Uint8Array | number): boolean {
return (
bscript.isCanonicalScriptSignature(x as Uint8Array) ||
(opts!.allowIncomplete && (x as number) === OPS.OP_0) !== undefined
!!(opts!.allowIncomplete && (x as number) === OPS.OP_0)
);
}

Expand Down