Browse Source
add lnworker.main_loop to network.futures so it gets cancelled on exit. fix aiosafe verbosity.
regtest_lnd
ThomasV
7 years ago
committed by
SomberNight
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
2 changed files with
2 additions and
2 deletions
-
electrum/lnbase.py
-
electrum/lnworker.py
|
@ -275,7 +275,7 @@ def aiosafe(f): |
|
|
try: |
|
|
try: |
|
|
return await f(*args, **kwargs) |
|
|
return await f(*args, **kwargs) |
|
|
except BaseException as e: |
|
|
except BaseException as e: |
|
|
self.print_msg("Exception in", f.__name__, ":", e.__class__.__name__, str(e)) |
|
|
self.print_error("Exception in", f.__name__, ":", e.__class__.__name__, str(e)) |
|
|
self.exception = e |
|
|
self.exception = e |
|
|
return f2 |
|
|
return f2 |
|
|
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ class LNWorker(PrintError): |
|
|
# wait until we see confirmations |
|
|
# wait until we see confirmations |
|
|
self.network.register_callback(self.on_network_update, ['updated', 'verified']) # thread safe |
|
|
self.network.register_callback(self.on_network_update, ['updated', 'verified']) # thread safe |
|
|
self.on_network_update('updated') # shortcut (don't block) if funding tx locked and verified |
|
|
self.on_network_update('updated') # shortcut (don't block) if funding tx locked and verified |
|
|
asyncio.run_coroutine_threadsafe(self.main_loop(), asyncio.get_event_loop()) |
|
|
self.network.futures.append(asyncio.run_coroutine_threadsafe(self.main_loop(), asyncio.get_event_loop())) |
|
|
|
|
|
|
|
|
def channels_for_peer(self, node_id): |
|
|
def channels_for_peer(self, node_id): |
|
|
assert type(node_id) is bytes |
|
|
assert type(node_id) is bytes |
|
|