TransactionOutput: fix regression with calculating getMinNonDustValue() for the multisig case

This commit is contained in:
Andreas Schildbach 2021-10-12 09:24:55 +02:00 committed by Sean Gilligan
parent 8c3cf0acd5
commit c68cd2e616

View File

@ -234,7 +234,7 @@ public class TransactionOutput {
// 294 satoshis at the default rate of 3000 sat/kB. // 294 satoshis at the default rate of 3000 sat/kB.
long size = this.serialize().length; long size = this.serialize().length;
final Script script = getScriptPubKey(); final Script script = getScriptPubKey();
if (ScriptPattern.isP2PKH(script) || ScriptPattern.isP2PK(script) || ScriptPattern.isP2SH(script)) if (ScriptPattern.isP2PKH(script) || ScriptPattern.isP2PK(script) || ScriptPattern.isP2SH(script) || ScriptPattern.isSentToMultisig(script))
size += 32 + 4 + 1 + 107 + 4; // 148 size += 32 + 4 + 1 + 107 + 4; // 148
else if (ScriptPattern.isP2WH(script)) else if (ScriptPattern.isP2WH(script))
size += 32 + 4 + 1 + (107 / 4) + 4; // 68 size += 32 + 4 + 1 + (107 / 4) + 4; // 68