Fix dust limit for undefined witness program outputs

This commit is contained in:
Mononaut 2024-06-30 02:06:50 +00:00
parent 98e9d1a6c3
commit 425edb9b9f
No known key found for this signature in database
GPG key ID: A3F058E41374C04E
2 changed files with 2 additions and 2 deletions

View file

@ -292,7 +292,7 @@ export class Common {
dustSize += getVarIntLength(dustSize);
// add value size
dustSize += 8;
if (['v0_p2wpkh', 'v0_p2wsh', 'v1_p2tr'].includes(vout.scriptpubkey_type)) {
if (Common.isWitnessProgram(vout.scriptpubkey)) {
dustSize += 67;
} else {
dustSize += 148;

View file

@ -181,7 +181,7 @@ export function isNonStandard(tx: Transaction): boolean {
dustSize += getVarIntLength(dustSize);
// add value size
dustSize += 8;
if (['v0_p2wpkh', 'v0_p2wsh', 'v1_p2tr'].includes(vout.scriptpubkey_type)) {
if (isWitnessProgram(vout.scriptpubkey)) {
dustSize += 67;
} else {
dustSize += 148;