From 563af71ed262debf3dff580812ed62712bfa550b Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 1 Apr 2021 09:52:19 +0200 Subject: [PATCH] log errors on failed qr psbt parsing --- drongo | 2 +- .../sparrowwallet/sparrow/control/QRScanDialog.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drongo b/drongo index e974c3f4..49654b7c 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit e974c3f4223d1771aa59013c31311cf3d85e0915 +Subproject commit 49654b7c82d104f7898eff95f0ac3cec96fbc0ec diff --git a/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java index aead72d1..f6d744be 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java @@ -16,6 +16,7 @@ import com.sparrowwallet.drongo.protocol.Base43; import com.sparrowwallet.drongo.protocol.ScriptType; import com.sparrowwallet.drongo.protocol.Transaction; import com.sparrowwallet.drongo.psbt.PSBT; +import com.sparrowwallet.drongo.psbt.PSBTParseException; import com.sparrowwallet.drongo.uri.BitcoinURI; import com.sparrowwallet.drongo.wallet.Keystore; import com.sparrowwallet.drongo.wallet.Wallet; @@ -193,6 +194,10 @@ public class QRScanDialog extends Dialog { PSBT psbt = PSBT.fromString(complete); result = new Result(psbt); return; + } catch(PSBTParseException e) { + if(PSBT.isPSBT(complete)) { + log.error("Error parsing PSBT", e); + } } catch(Exception e) { //ignore, bytes not parsable as PSBT } @@ -241,6 +246,10 @@ public class QRScanDialog extends Dialog { psbt = PSBT.fromString(qrtext); result = new Result(psbt); return; + } catch(PSBTParseException e) { + if(PSBT.isPSBT(qrtext)) { + log.error("Error parsing PSBT", e); + } } catch(Exception e) { //Ignore, not parseable as Base64 or hex } @@ -299,6 +308,10 @@ public class QRScanDialog extends Dialog { try { PSBT psbt = new PSBT(urBytes); return new Result(psbt); + } catch(PSBTParseException e) { + if(PSBT.isPSBT(urBytes)) { + log.error("Error parsing PSBT", e); + } } catch(Exception e) { //ignore, bytes not parsable as PSBT }