From ca313631804cbf270ad32b1ef6479b48168098c0 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Mon, 30 Mar 2020 14:53:52 -0400 Subject: [PATCH] listen for on_read.first before it is triggered --- lbry/wallet/ledger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index 6e9607b58..d3b63eacd 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -317,6 +317,7 @@ class Ledger(metaclass=LedgerRegistry): self.headers.open() ]) first_connection = self.network.on_connected.first + first_ready = self.on_ready.first asyncio.ensure_future(self.network.start()) await first_connection async with self._header_processing_lock: @@ -328,7 +329,7 @@ class Ledger(metaclass=LedgerRegistry): else: await self._report_state() self.on_transaction.listen(self._reset_balance_cache) - await self.on_ready.first + await first_ready async def join_network(self, *_): log.info("Subscribing and updating accounts.")