mirror of
https://github.com/basicswap/basicswap.git
synced 2026-04-08 18:37:23 +02:00
Added graceful shutdown for electrum.
This commit is contained in:
@@ -740,6 +740,15 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
self._network.stopNetwork()
|
self._network.stopNetwork()
|
||||||
self._network = None
|
self._network = None
|
||||||
|
|
||||||
|
for coin_type, interface in self.coin_interfaces.items():
|
||||||
|
if hasattr(interface, "_backend") and interface._backend is not None:
|
||||||
|
try:
|
||||||
|
if hasattr(interface._backend, "_server"):
|
||||||
|
interface._backend._server.disconnect()
|
||||||
|
self.log.debug(f"Disconnected electrum backend for {coin_type}")
|
||||||
|
except Exception as e:
|
||||||
|
self.log.debug(f"Error disconnecting electrum backend: {e}")
|
||||||
|
|
||||||
self.log.info("Stopping threads.")
|
self.log.info("Stopping threads.")
|
||||||
for t in self.threads:
|
for t in self.threads:
|
||||||
if hasattr(t, "stop") and callable(t.stop):
|
if hasattr(t, "stop") and callable(t.stop):
|
||||||
|
|||||||
Reference in New Issue
Block a user