From 42783aaa928da79e1295dcdc53123a66cb2433cc Mon Sep 17 00:00:00 2001 From: Justin Moon Date: Sun, 10 Jul 2022 13:28:42 +0200 Subject: [PATCH] cln_plugin: Configure "dynamic" field in "getmanifest" message --- plugins/src/lib.rs | 9 +++++++++ plugins/src/messages.rs | 1 + 2 files changed, 10 insertions(+) diff --git a/plugins/src/lib.rs b/plugins/src/lib.rs index 876bf59d3..53720790c 100644 --- a/plugins/src/lib.rs +++ b/plugins/src/lib.rs @@ -48,6 +48,7 @@ where configuration: Option, rpcmethods: HashMap>, subscriptions: HashMap>, + dynamic: bool, } impl Builder @@ -66,6 +67,7 @@ where options: vec![], configuration: None, rpcmethods: HashMap::new(), + dynamic: false, } } @@ -142,6 +144,12 @@ where self } + /// Send true value for "dynamic" field in "getmanifest" response + pub fn dynamic(mut self) -> Builder { + self.dynamic = true; + self + } + /// Communicate with `lightningd` to tell it about our options, /// RPC methods and subscribe to hooks, and then process the /// initialization, configuring the plugin. @@ -280,6 +288,7 @@ where subscriptions: self.subscriptions.keys().map(|s| s.clone()).collect(), hooks: self.hooks.keys().map(|s| s.clone()).collect(), rpcmethods, + dynamic: self.dynamic, } } diff --git a/plugins/src/messages.rs b/plugins/src/messages.rs index 90be18872..9b23e4395 100644 --- a/plugins/src/messages.rs +++ b/plugins/src/messages.rs @@ -156,6 +156,7 @@ pub(crate) struct GetManifestResponse { pub(crate) rpcmethods: Vec, pub(crate) subscriptions: Vec, pub(crate) hooks: Vec, + pub(crate) dynamic: bool, } #[derive(Serialize, Default, Debug)]