diff --git a/src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java b/src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java index 91e9f6b..f75fb63 100644 --- a/src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java +++ b/src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java @@ -109,7 +109,8 @@ public class PSBT { WalletNode walletNode = utxoEntry.getValue(); Wallet signingWallet = walletNode.getWallet(); - boolean alwaysIncludeWitnessUtxo = signingWallet.getKeystores().stream().anyMatch(keystore -> keystore.getWalletModel().alwaysIncludeNonWitnessUtxo()); + boolean alwaysIncludeNonWitnessTx = signingWallet.getKeystores().stream().anyMatch(keystore -> keystore.getWalletModel().alwaysIncludeNonWitnessUtxo()) + && !ScriptType.P2TR.equals(signingWallet.getScriptType()); Transaction utxo = signingWallet.getTransactions().get(utxoEntry.getKey().getHash()).getTransaction(); int utxoIndex = (int)utxoEntry.getKey().getIndex(); @@ -138,7 +139,7 @@ public class PSBT { } } - PSBTInput psbtInput = new PSBTInput(this, signingWallet.getScriptType(), inputIndex, utxo, utxoIndex, redeemScript, witnessScript, derivedPublicKeys, Collections.emptyMap(), tapInternalKey, alwaysIncludeWitnessUtxo); + PSBTInput psbtInput = new PSBTInput(this, signingWallet.getScriptType(), inputIndex, utxo, utxoIndex, redeemScript, witnessScript, derivedPublicKeys, Collections.emptyMap(), tapInternalKey, alwaysIncludeNonWitnessTx); psbtInputs.add(psbtInput); } diff --git a/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java b/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java index 5a3b5c8..3f42cfd 100644 --- a/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java +++ b/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java @@ -86,7 +86,7 @@ public class PSBTInput { } if(alwaysAddNonWitnessTx) { - //Add non-witness UTXO to segwit types to handle Trezor, Bitbox and Ledger requirements + //Add non-witness UTXO to segwit v0 types to handle Trezor, Bitbox and Ledger requirements this.nonWitnessUtxo = utxo; } diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/WalletModel.java b/src/main/java/com/sparrowwallet/drongo/wallet/WalletModel.java index 570786d..5783fe7 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/WalletModel.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/WalletModel.java @@ -56,7 +56,8 @@ public enum WalletModel { } public boolean alwaysIncludeNonWitnessUtxo() { - if(this == COLDCARD || this == COBO_VAULT || this == PASSPORT || this == KEYSTONE || this == GORDIAN_SEED_TOOL || this == SEEDSIGNER || this == KRUX) { + if(this == COLDCARD || this == COBO_VAULT || this == PASSPORT || this == KEYSTONE || this == GORDIAN_SEED_TOOL || this == SEEDSIGNER || this == KRUX || this == JADE || + this == TAPSIGNER || this == SATOCHIP) { return false; }