1
0

channel_db: raise specific exception if database is not loaded when we try to find a route

This commit is contained in:
ThomasV
2020-03-10 15:11:16 +01:00
parent e3019a7046
commit beac1c4ddc
3 changed files with 6 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ class MockNetwork:
self.config = simple_config.SimpleConfig(user_config, read_user_dir_function=lambda: user_dir)
self.asyncio_loop = asyncio.get_event_loop()
self.channel_db = ChannelDB(self)
self.channel_db.data_loaded.set()
self.path_finder = LNPathFinder(self.channel_db)
self.tx_queue = tx_queue

View File

@@ -49,6 +49,7 @@ class Test_LNRouter(TestCaseForTestnet):
register_callback = lambda *args: None
interface = None
fake_network.channel_db = lnrouter.ChannelDB(fake_network())
fake_network.channel_db.data_loaded.set()
cdb = fake_network.channel_db
path_finder = lnrouter.LNPathFinder(cdb)
self.assertEqual(cdb.num_channels, 0)