show psbt qrs without non witness utxo entries for segwit signing wallets

This commit is contained in:
Craig Raw 2023-03-07 13:17:33 +02:00
parent 84978a3d5d
commit 107b5ba36c
3 changed files with 5 additions and 3 deletions

2
drongo

@ -1 +1 @@
Subproject commit 0f78efc373e99cf48a749ced25cd112ca083b88f
Subproject commit 7eab644cecc71e591ba805cff1a408b9f31a9303

View file

@ -753,7 +753,7 @@ public class AppController implements Initializable {
writer.print(transactionTabData.getPsbt().toBase64String(includeXpubs));
writer.flush();
} else {
outputStream.write(transactionTabData.getPsbt().serialize(includeXpubs));
outputStream.write(transactionTabData.getPsbt().serialize(includeXpubs, true));
}
} catch(IOException e) {
log.error("Error saving PSBT", e);

View file

@ -864,7 +864,9 @@ public class HeadersController extends TransactionFormController implements Init
//TODO: Remove once Cobo Vault has upgraded to UR2.0
boolean addLegacyEncodingOption = headersForm.getSigningWallet().getKeystores().stream().anyMatch(keystore -> keystore.getWalletModel().equals(WalletModel.COBO_VAULT));
CryptoPSBT cryptoPSBT = new CryptoPSBT(headersForm.getPsbt().serialize());
//Don't include non witness utxo fields for segwit wallets when displaying the PSBT as a QR - it can add greatly to the time required for scanning
boolean includeNonWitnessUtxos = !Arrays.asList(ScriptType.WITNESS_TYPES).contains(headersForm.getSigningWallet().getScriptType());
CryptoPSBT cryptoPSBT = new CryptoPSBT(headersForm.getPsbt().serialize(true, includeNonWitnessUtxos));
QRDisplayDialog qrDisplayDialog = new QRDisplayDialog(cryptoPSBT.toUR(), addLegacyEncodingOption);
qrDisplayDialog.show();
}