Browse Source

log errors on failed qr psbt parsing

terminal
Craig Raw 4 years ago
parent
commit
563af71ed2
  1. 2
      drongo
  2. 13
      src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java

2
drongo

@ -1 +1 @@
Subproject commit e974c3f4223d1771aa59013c31311cf3d85e0915
Subproject commit 49654b7c82d104f7898eff95f0ac3cec96fbc0ec

13
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<QRScanDialog.Result> {
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<QRScanDialog.Result> {
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<QRScanDialog.Result> {
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
}

Loading…
Cancel
Save