From f39961d3e1bdd672dd0f23f20ec86b3fc4eb4974 Mon Sep 17 00:00:00 2001 From: Nick Klockenga Date: Tue, 19 Oct 2021 15:34:51 -0400 Subject: [PATCH] fix when descriptor has newlines/whitespace --- src/seedsigner/models/decode_qr.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/seedsigner/models/decode_qr.py b/src/seedsigner/models/decode_qr.py index 9d07ed78..07f90b9c 100644 --- a/src/seedsigner/models/decode_qr.py +++ b/src/seedsigner/models/decode_qr.py @@ -255,10 +255,11 @@ class DecodeQR: return QRType.PSBTBASE64 # Wallet Descriptor - elif re.search(r'^p(\d+)of(\d+) ', s, re.IGNORECASE): + desc_str = s.replace("\n","").replace(" ","") + if re.search(r'^p(\d+)of(\d+) ', s, re.IGNORECASE): # when not a SPECTER Base64 PSBT from above, assume it's json return QRType.SPECTERWALLETQR - elif re.search(r'^\{\"label\".*\"descriptor\"\:.*', s, re.IGNORECASE): + elif re.search(r'^\{\"label\".*\"descriptor\"\:.*', desc_str, re.IGNORECASE): # if json starting with label and contains descriptor, assume specter wallet json return QRType.SPECTERWALLETQR