mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
plugin: Store a plugin's featurebits in the plugin struct
We'll collect the featurebits on-demand from all currently active plugins when needed.
This commit is contained in:
committed by
Rusty Russell
parent
966ac95098
commit
ea62d97879
@@ -26,6 +26,22 @@ enum plugin_state {
|
||||
CONFIGURED
|
||||
};
|
||||
|
||||
/**
|
||||
* A plugin may register any number of featurebits that should be added to
|
||||
* various messages as part of their manifest. The following enum enumerates
|
||||
* the possible locations the featurebits can be added to, and are used as
|
||||
* indices into the array of featurebits in the plugin struct itself.
|
||||
*
|
||||
* If you edit this make sure that there is a matching entry in the
|
||||
* `plugin_features_type_names[]` array in plugin.c.
|
||||
*/
|
||||
enum plugin_features_type {
|
||||
PLUGIN_FEATURES_NODE,
|
||||
PLUGIN_FEATURES_INIT,
|
||||
PLUGIN_FEATURES_INVOICE,
|
||||
};
|
||||
#define NUM_PLUGIN_FEATURES_TYPE (PLUGIN_FEATURES_INVOICE+1)
|
||||
|
||||
/**
|
||||
* A plugin, exposed as a stub so we can pass it as an argument.
|
||||
*/
|
||||
@@ -66,6 +82,11 @@ struct plugin {
|
||||
|
||||
/* An array of subscribed topics */
|
||||
char **subscriptions;
|
||||
|
||||
/* Featurebits for various locations that the plugin
|
||||
* registered. Indices correspond to the `plugin_features_type`
|
||||
* enum. */
|
||||
u8 *featurebits[NUM_PLUGIN_FEATURES_TYPE];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user