Fix: Allow detection of 1 byte annexes

This commit is contained in:
junderw 2023-07-13 13:31:57 +09:00
parent 95a8752a0a
commit 43d41fca95
No known key found for this signature in database
GPG key ID: B256185D3A971908

View file

@ -560,7 +560,6 @@ export class Common {
const witness = input.witness; const witness = input.witness;
// See BIP 341: Script validation rules // See BIP 341: Script validation rules
const hasAnnex = witness.length >= 2 && const hasAnnex = witness.length >= 2 &&
witness[witness.length - 1].length > 1 &&
witness[witness.length - 1][0] === 0x50; witness[witness.length - 1][0] === 0x50;
const scriptSpendMinLength = hasAnnex ? 3 : 2; const scriptSpendMinLength = hasAnnex ? 3 : 2;
const maybeScriptSpend = witness.length >= scriptSpendMinLength; const maybeScriptSpend = witness.length >= scriptSpendMinLength;