start() should not return until ledger has finished starting, which means self.join_network() needs to be yielded on the first connection

This commit is contained in:
Lex Berezhny 2018-10-08 23:27:32 -04:00
parent d02da2f3a5
commit 2723a55766

View file

@ -220,9 +220,10 @@ class BaseLedger(metaclass=LedgerRegistry):
self.headers.open()
])
first_connection = self.network.on_connected.first
self.network.on_connected.listen(self.join_network)
self.network.start()
yield first_connection
yield self.join_network()
self.network.on_connected.listen(self.join_network)
@defer.inlineCallbacks
def join_network(self, *args):