Merge pull request #5237 from vostrnad/p2tr-without-witness

Fix errors caused by P2TR inputs without witness data
This commit is contained in:
softsimon
2024-07-01 10:48:16 +09:00
committed by GitHub
3 changed files with 35 additions and 29 deletions

View File

@@ -460,11 +460,10 @@ export class Common {
case 'v0_p2wpkh': flags |= TransactionFlags.p2wpkh; break;
case 'v0_p2wsh': flags |= TransactionFlags.p2wsh; break;
case 'v1_p2tr': {
if (!vin.witness?.length) {
throw new Error('Taproot input missing witness data');
}
flags |= TransactionFlags.p2tr;
flags = Common.isInscription(vin, flags);
if (vin.witness?.length) {
flags = Common.isInscription(vin, flags);
}
} break;
}
} else {