Skip to content

Commit

Permalink
grpc: Do not print wildcard notifications that don't have a handler
Browse files Browse the repository at this point in the history
Changelog-Fixed: grpc: We no longer log a warning if a notification does not have a handler
  • Loading branch information
cdecker committed Nov 25, 2024
1 parent 46fde41 commit 7b18030
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/grpc-plugin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit 7b18030

Please sign in to comment.