mirror of
https://github.com/sparrowwallet/drongo.git
synced 2025-01-24 22:21:10 +00:00
exclude taproot wallets and jade, tapsigner and satochip hwws from requiring non witness tx in psbts
This commit is contained in:
parent
f67a2caf53
commit
378ab611f5
3 changed files with 6 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue