From c68cd2e6163b3d266453b57c34a0f518884a4984 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Tue, 12 Oct 2021 09:24:55 +0200 Subject: [PATCH] TransactionOutput: fix regression with calculating getMinNonDustValue() for the multisig case --- core/src/main/java/org/bitcoinj/core/TransactionOutput.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/bitcoinj/core/TransactionOutput.java b/core/src/main/java/org/bitcoinj/core/TransactionOutput.java index f7658bc51..b191c7ccf 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionOutput.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionOutput.java @@ -234,7 +234,7 @@ public class TransactionOutput { // 294 satoshis at the default rate of 3000 sat/kB. long size = this.serialize().length; 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 else if (ScriptPattern.isP2WH(script)) size += 32 + 4 + 1 + (107 / 4) + 4; // 68