From 32f88ae419a863d97e8904c3ea0ad16bb265d991 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 30 May 2022 21:42:52 +0200 Subject: [PATCH] util: rm a magic number --- electrum/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electrum/util.py b/electrum/util.py index 7a0044501..22835f5cd 100644 --- a/electrum/util.py +++ b/electrum/util.py @@ -1069,7 +1069,8 @@ def maybe_extract_bolt11_invoice(data: str) -> Optional[str]: data = data.strip() # whitespaces data = data.lower() if data.startswith(LIGHTNING_URI_SCHEME + ':ln'): - data = data[10:] + cut_prefix = LIGHTNING_URI_SCHEME + ':' + data = data[len(cut_prefix):] if data.startswith('ln'): return data return None