log errors on failed qr psbt parsing

This commit is contained in:
Craig Raw 2021-04-01 09:52:19 +02:00
parent f8fa929166
commit 563af71ed2
2 changed files with 14 additions and 1 deletions

2
drongo

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

View file

@ -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
}