bolt11 invoice: strip (and so accept with) leading/trailing whitespaces
This commit is contained in:
@@ -930,11 +930,12 @@ def create_bip21_uri(addr, amount_sat: Optional[int], message: Optional[str],
|
|||||||
|
|
||||||
|
|
||||||
def maybe_extract_bolt11_invoice(data: str) -> Optional[str]:
|
def maybe_extract_bolt11_invoice(data: str) -> Optional[str]:
|
||||||
lower = data.lower()
|
data = data.strip() # whitespaces
|
||||||
if lower.startswith('lightning:ln'):
|
data = data.lower()
|
||||||
lower = lower[10:]
|
if data.startswith('lightning:ln'):
|
||||||
if lower.startswith('ln'):
|
data = data[10:]
|
||||||
return lower
|
if data.startswith('ln'):
|
||||||
|
return data
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user