fix when descriptor has newlines/whitespace

This commit is contained in:
Nick Klockenga
2021-10-19 15:34:51 -04:00
parent 2612cda43e
commit f39961d3e1
+3 -2
View File
@@ -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