mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 13:16:44 +00:00
show psbt qrs without non witness utxo entries for segwit signing wallets
This commit is contained in:
parent
84978a3d5d
commit
107b5ba36c
3 changed files with 5 additions and 3 deletions
2
drongo
2
drongo
|
@ -1 +1 @@
|
||||||
Subproject commit 0f78efc373e99cf48a749ced25cd112ca083b88f
|
Subproject commit 7eab644cecc71e591ba805cff1a408b9f31a9303
|
|
@ -753,7 +753,7 @@ public class AppController implements Initializable {
|
||||||
writer.print(transactionTabData.getPsbt().toBase64String(includeXpubs));
|
writer.print(transactionTabData.getPsbt().toBase64String(includeXpubs));
|
||||||
writer.flush();
|
writer.flush();
|
||||||
} else {
|
} else {
|
||||||
outputStream.write(transactionTabData.getPsbt().serialize(includeXpubs));
|
outputStream.write(transactionTabData.getPsbt().serialize(includeXpubs, true));
|
||||||
}
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
log.error("Error saving PSBT", e);
|
log.error("Error saving PSBT", e);
|
||||||
|
|
|
@ -864,7 +864,9 @@ public class HeadersController extends TransactionFormController implements Init
|
||||||
//TODO: Remove once Cobo Vault has upgraded to UR2.0
|
//TODO: Remove once Cobo Vault has upgraded to UR2.0
|
||||||
boolean addLegacyEncodingOption = headersForm.getSigningWallet().getKeystores().stream().anyMatch(keystore -> keystore.getWalletModel().equals(WalletModel.COBO_VAULT));
|
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 qrDisplayDialog = new QRDisplayDialog(cryptoPSBT.toUR(), addLegacyEncodingOption);
|
||||||
qrDisplayDialog.show();
|
qrDisplayDialog.show();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue