From dc286a967ad42a635d94ca45fa5a1adb49f74907 Mon Sep 17 00:00:00 2001 From: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:36:30 +0900 Subject: [PATCH] Mix: Don't panic on SendError in libp2p mix backend (#919) --- nomos-services/mix/src/backends/libp2p.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nomos-services/mix/src/backends/libp2p.rs b/nomos-services/mix/src/backends/libp2p.rs index c580f154..6577c4bd 100644 --- a/nomos-services/mix/src/backends/libp2p.rs +++ b/nomos-services/mix/src/backends/libp2p.rs @@ -178,7 +178,9 @@ impl MixSwarm { match event { SwarmEvent::Behaviour(nomos_mix_network::Event::Message(msg)) => { tracing::debug!("Received message from a peer: {msg:?}"); - self.incoming_message_sender.send(msg).unwrap(); + if let Err(e) = self.incoming_message_sender.send(msg) { + tracing::error!("Failed to send incoming message to channel: {e}"); + } } SwarmEvent::Behaviour(nomos_mix_network::Event::Error(e)) => { tracing::error!("Received error from mix network: {e:?}");