MCPcopy Create free account
hub / github.com/ElementsProject/lightning / handle_notification

Function handle_notification

plugins/grpc-plugin/src/main.rs:172–188  ·  view source on GitHub ↗
(plugin: Plugin<PluginState>, value: serde_json::Value)

Source from the content-addressed store, hash-verified

170}
171
172async fn handle_notification(plugin: Plugin<PluginState>, value: serde_json::Value) -> Result<()> {
173 let notification: Result<Notification, _> = serde_json::from_value(value);
174 match notification {
175 Err(err) => {
176 log::debug!("Failed to parse notification from lightningd {:?}", err);
177 }
178 Ok(notification) => {
179 /* Depending on whether or not there is a wildcard
180 * subscription we may receive notifications for which we
181 * don't have a handler. We suppress the `SendError` which
182 * would indicate there is no subscriber for the given
183 * topic. */
184 let _ = plugin.state().events.send(notification);
185 }
186 };
187 Ok(())
188}
189
190fn log_error(error: String) {
191 println!(

Callers

nothing calls this directly

Calls 2

stateMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected