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
This commit is contained in:
Christian Decker 2024-11-25 14:22:38 +01:00
parent 46fde419b1
commit 7b18030ee2

View file

@ -138,9 +138,12 @@ async fn handle_notification(plugin: Plugin<PluginState>, 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(())