From 6c1e589ee803ee3c37b8e1a2d81b2fde39007b45 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Fri, 25 Nov 2022 13:13:47 +0100 Subject: [PATCH] cln-plugin: make available the configuration in plugin There are several cases where you want to access to the configuration, and given the nature of the rust API, there is no way to access to the `configuration` field at any point after the configuration logic. Suggested-by: Sergi Delgado Segura <@sr-gi> Signed-off-by: Vincenzo Palazzo --- plugins/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/src/lib.rs b/plugins/src/lib.rs index a0d29289d..8b8580df3 100644 --- a/plugins/src/lib.rs +++ b/plugins/src/lib.rs @@ -495,6 +495,12 @@ where .next() .map(|co| co.value.clone().unwrap_or(co.default().clone())) } + + /// return the cln configuration send to the + /// plugin after the initialization. + pub fn configuration(&self) -> Configuration { + self.configuration.clone() + } } impl PluginDriver