Skip to content

Commit

Permalink
propagate lost server connection errors to client
Browse files Browse the repository at this point in the history
- set exception on response future when connection to server is lost
  • Loading branch information
philippem authored and doc-hex committed Jul 31, 2024
1 parent c893bc2 commit e631fb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions connectrum/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def _connection_lost(self, protocol):
self.protocol = None
logger.warn("Electrum server connection lost")

for (_, fut) in self.inflight.values():
fut.set_exception(ElectrumErrorResponse("Electrum server connection lost"))

self.inflight.clear()

# cleanup keep alive task
if self.ka_task:
self.ka_task.cancel()
Expand Down

0 comments on commit e631fb9

Please sign in to comment.