mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightningd: plugins_any_in_state and plugins_all_in_state helpers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -973,6 +973,28 @@ bool plugin_parse_getmanifest_response(const char *buffer,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool plugins_any_in_state(const struct plugins *plugins, enum plugin_state state)
|
||||||
|
{
|
||||||
|
const struct plugin *p;
|
||||||
|
|
||||||
|
list_for_each(&plugins->plugins, p, list) {
|
||||||
|
if (p->plugin_state == state)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool plugins_all_in_state(const struct plugins *plugins, enum plugin_state state)
|
||||||
|
{
|
||||||
|
const struct plugin *p;
|
||||||
|
|
||||||
|
list_for_each(&plugins->plugins, p, list) {
|
||||||
|
if (p->plugin_state != state)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback for the plugin_manifest request.
|
* Callback for the plugin_manifest request.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -208,6 +208,16 @@ struct plugin *find_plugin_for_command(struct lightningd *ld,
|
|||||||
*/
|
*/
|
||||||
void plugins_config(struct plugins *plugins);
|
void plugins_config(struct plugins *plugins);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are any plugins at this state still?
|
||||||
|
*/
|
||||||
|
bool plugins_any_in_state(const struct plugins *plugins, enum plugin_state state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are all plugins at this state?
|
||||||
|
*/
|
||||||
|
bool plugins_all_in_state(const struct plugins *plugins, enum plugin_state state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read and treat (populate options, methods, ...) the `getmanifest` response.
|
* Read and treat (populate options, methods, ...) the `getmanifest` response.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user