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

Function main

plugins/examples/cln-plugin-reentrant.rs:12–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11#[tokio::main]
12async fn main() -> Result<(), Error> {
13 let (tx, _) = broadcast::channel(4);
14 let state = State { tx };
15
16 if let Some(plugin) = Builder::new(tokio::io::stdin(), tokio::io::stdout())
17 .hook("htlc_accepted", htlc_accepted_handler)
18 .rpcmethod("release", "Release all HTLCs we currently hold", release)
19 .start(state)
20 .await?
21 {
22 plugin.join().await?;
23 Ok(())
24 } else {
25 Ok(())
26 }
27}
28
29/// Release all waiting HTLCs
30async fn release(p: Plugin<State>, _v: serde_json::Value) -> Result<serde_json::Value, Error> {

Callers

nothing calls this directly

Calls 5

rpcmethodMethod · 0.80
joinMethod · 0.80
channelClass · 0.50
startMethod · 0.45
hookMethod · 0.45

Tested by

no test coverage detected