1
0

persist channel db on disk. verify channel gossip sigs.

This commit is contained in:
SomberNight
2018-07-23 20:49:44 +02:00
committed by ThomasV
parent c1d1826014
commit a5b44d25b0
8 changed files with 396 additions and 55 deletions

View File

@@ -301,7 +301,7 @@ class Network(Logger):
# lightning network
self.lightning_nodes = {}
self.channel_db = lnrouter.ChannelDB()
self.channel_db = lnrouter.ChannelDB(self)
self.path_finder = lnrouter.LNPathFinder(self.channel_db)
self.lnwatcher = lnwatcher.LNWatcher(self)
@@ -1183,6 +1183,7 @@ class Network(Logger):
def stop(self):
assert self._loop_thread != threading.current_thread(), 'must not be called from network thread'
fut = asyncio.run_coroutine_threadsafe(self._stop(full_shutdown=True), self.asyncio_loop)
self.channel_db.save_data()
try:
fut.result(timeout=2)
except (asyncio.TimeoutError, asyncio.CancelledError): pass