From 7b18030ee2ab93efa2b3cec8bd2293fa5fd5ffc3 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 25 Nov 2024 14:22:38 +0100 Subject: [PATCH] grpc: Do not print wildcard notifications that don't have a handler Changelog-Fixed: grpc: We no longer log a warning if a notification does not have a handler --- plugins/grpc-plugin/src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/grpc-plugin/src/main.rs b/plugins/grpc-plugin/src/main.rs index 4839ae5b5..141e0952a 100644 --- a/plugins/grpc-plugin/src/main.rs +++ b/plugins/grpc-plugin/src/main.rs @@ -138,9 +138,12 @@ async fn handle_notification(plugin: Plugin, value: serde_json::Val log::debug!("Failed to parse notification from lightningd {:?}", err); } Ok(notification) => { - if let Err(err) = plugin.state().events.send(notification) { - log::warn!("Failed to broadcast notification {:?}", err) - } + /* Depending on whether or not there is a wildcard + * subscription we may receive notifications for which we + * don't have a handler. We suppress the `SendError` which + * would indicate there is no subscriber for the given + * topic. */ + let _ = plugin.state().events.send(notification); } }; Ok(())