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 <vincenzopalazzodev@gmail.com>
This commit is contained in:
Vincenzo Palazzo
2022-11-25 13:13:47 +01:00
committed by Christian Decker
parent 141c836b39
commit 6c1e589ee8

View File

@@ -495,6 +495,12 @@ where
.next() .next()
.map(|co| co.value.clone().unwrap_or(co.default().clone())) .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<S> PluginDriver<S> impl<S> PluginDriver<S>