From 0bc2dbe8991d4b183b15817be05b6e27198a9de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Granh=C3=A3o?= <32176319+danielgranhao@users.noreply.github.com> Date: Tue, 27 May 2025 11:19:40 +0100 Subject: [PATCH] Fix status stream task shutdown (#935) --- lib/core/src/swapper/boltz/status_stream.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/core/src/swapper/boltz/status_stream.rs b/lib/core/src/swapper/boltz/status_stream.rs index 0cf684a..d8750c5 100644 --- a/lib/core/src/swapper/boltz/status_stream.rs +++ b/lib/core/src/swapper/boltz/status_stream.rs @@ -46,6 +46,18 @@ impl SwapperStatusStream for BoltzSwapper

{ tokio::spawn(async move { loop { debug!("Start of ws stream loop"); + match shutdown.has_changed() { + Ok(true) => { + info!("Received shutdown signal, exiting Status Stream loop"); + return; + } + Ok(false) => {} + Err(_) => { + warn!("Shutdown channel was closed, exiting Status Stream loop"); + return; + } + } + let mut request_stream = self.request_notifier.subscribe(); let client = match swapper.get_boltz_client().await { Ok(client) => client,