SomberNight
2 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
2 changed files with
8 additions and
5 deletions
-
electrum/gui/kivy/uix/screens.py
-
electrum/lnurl.py
|
|
@ -237,9 +237,12 @@ class SendScreen(CScreen, Logger): |
|
|
|
def set_lnurl6(self, lnurl: str): |
|
|
|
url = decode_lnurl(lnurl) |
|
|
|
domain = urlparse(url).netloc |
|
|
|
# FIXME network request blocking GUI thread: |
|
|
|
lnurl_data = Network.run_from_another_thread(request_lnurl(url)) |
|
|
|
if not lnurl_data: |
|
|
|
try: |
|
|
|
# FIXME network request blocking GUI thread: |
|
|
|
lnurl_data = Network.run_from_another_thread(request_lnurl(url)) |
|
|
|
except LNURLError as e: |
|
|
|
self.app.show_error(f"LNURL request encountered error: {e}") |
|
|
|
self.do_clear() |
|
|
|
return |
|
|
|
self.lnurl_data = lnurl_data |
|
|
|
self.address = "invoice from lnurl" |
|
|
|
|
|
@ -66,11 +66,11 @@ async def _request_lnurl(url: str) -> dict: |
|
|
|
return response |
|
|
|
|
|
|
|
|
|
|
|
async def request_lnurl(url: str) -> Optional[LNURL6Data]: |
|
|
|
async def request_lnurl(url: str) -> LNURL6Data: |
|
|
|
lnurl_dict = await _request_lnurl(url) |
|
|
|
tag = lnurl_dict.get('tag') |
|
|
|
if tag != 'payRequest': # only LNURL6 is handled atm |
|
|
|
return None |
|
|
|
raise LNURLError(f"Unknown subtype of lnurl. tag={tag}") |
|
|
|
metadata = lnurl_dict.get('metadata') |
|
|
|
metadata_plaintext = "" |
|
|
|
for m in metadata: |
|
|
|