ThomasV
6 years ago
committed by
SomberNight
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
2 additions and
2 deletions
-
electrum/lnaddr.py
|
@ -52,7 +52,7 @@ def unshorten_amount(amount): |
|
|
# BOLT #11: |
|
|
# BOLT #11: |
|
|
# A reader SHOULD fail if `amount` contains a non-digit, or is followed by |
|
|
# A reader SHOULD fail if `amount` contains a non-digit, or is followed by |
|
|
# anything except a `multiplier` in the table above. |
|
|
# anything except a `multiplier` in the table above. |
|
|
if not re.fullmatch("\d+[pnum]?", str(amount)): |
|
|
if not re.fullmatch("\\d+[pnum]?", str(amount)): |
|
|
raise ValueError("Invalid amount '{}'".format(amount)) |
|
|
raise ValueError("Invalid amount '{}'".format(amount)) |
|
|
|
|
|
|
|
|
if unit in units.keys(): |
|
|
if unit in units.keys(): |
|
@ -286,7 +286,7 @@ def lndecode(a, verbose=False, expected_hrp=None): |
|
|
addr = LnAddr() |
|
|
addr = LnAddr() |
|
|
addr.pubkey = None |
|
|
addr.pubkey = None |
|
|
|
|
|
|
|
|
m = re.search("[^\d]+", hrp[2:]) |
|
|
m = re.search("[^\\d]+", hrp[2:]) |
|
|
if m: |
|
|
if m: |
|
|
addr.currency = m.group(0) |
|
|
addr.currency = m.group(0) |
|
|
amountstr = hrp[2+m.end():] |
|
|
amountstr = hrp[2+m.end():] |
|
|