Also fix backend errors caused by P2TR inputs without witness data

This commit is contained in:
Mononaut 2024-07-01 01:22:10 +00:00
parent 7432e6e29b
commit 27c70bd919
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

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