mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
lnpeer: Peer.is_initialized() should not raise
Traceback (most recent call last): File "...\electrum\electrum\gui\qt\main_window.py", line 434, in on_network_qt self.update_lightning_icon() File "...\electrum\electrum\gui\qt\main_window.py", line 2092, in update_lightning_icon cur, total = self.network.lngossip.get_sync_progress_estimate() File "...\electrum\electrum\lnworker.py", line 373, in get_sync_progress_estimate if self.num_peers() == 0: File "...\electrum\electrum\lnworker.py", line 202, in num_peers return sum([p.is_initialized() for p in self.peers.values()]) File "...\electrum\electrum\lnworker.py", line 202, in return sum([p.is_initialized() for p in self.peers.values()]) File "...\electrum\electrum\lnpeer.py", line 128, in is_initialized return self.initialized.done() and self.initialized.result() is True concurrent.futures._base.CancelledError
This commit is contained in:
parent
67d24bf129
commit
0147623d11
1 changed files with 5 additions and 2 deletions
|
@ -124,8 +124,11 @@ class Peer(Logger):
|
|||
if self._sent_init and self._received_init:
|
||||
self.initialized.set_result(True)
|
||||
|
||||
def is_initialized(self):
|
||||
return self.initialized.done() and self.initialized.result() is True
|
||||
def is_initialized(self) -> bool:
|
||||
return (self.initialized.done()
|
||||
and not self.initialized.cancelled()
|
||||
and self.initialized.exception() is None
|
||||
and self.initialized.result() is True)
|
||||
|
||||
async def initialize(self):
|
||||
if isinstance(self.transport, LNTransport):
|
||||
|
|
Loading…
Add table
Reference in a new issue