|
@ -3,6 +3,7 @@ |
|
|
#include <ccan/opt/opt.h> |
|
|
#include <ccan/opt/opt.h> |
|
|
#include <ccan/tal/str/str.h> |
|
|
#include <ccan/tal/str/str.h> |
|
|
#include <ccan/utf8/utf8.h> |
|
|
#include <ccan/utf8/utf8.h> |
|
|
|
|
|
#include <common/features.h> |
|
|
#include <common/utils.h> |
|
|
#include <common/utils.h> |
|
|
#include <common/version.h> |
|
|
#include <common/version.h> |
|
|
#include <lightningd/json.h> |
|
|
#include <lightningd/json.h> |
|
@ -46,6 +47,18 @@ struct plugins *plugins_new(const tal_t *ctx, struct log_book *log_book, |
|
|
return p; |
|
|
return p; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
u8 *plugins_collect_featurebits(const tal_t *ctx, const struct plugins *plugins, |
|
|
|
|
|
enum plugin_features_type type) |
|
|
|
|
|
{ |
|
|
|
|
|
struct plugin *p; |
|
|
|
|
|
u8 *res = tal_arr(ctx, u8, 0); |
|
|
|
|
|
list_for_each(&plugins->plugins, p, list) { |
|
|
|
|
|
if (p->featurebits[type]) |
|
|
|
|
|
res = featurebits_or(ctx, take(res), p->featurebits[type]); |
|
|
|
|
|
} |
|
|
|
|
|
return res; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static void destroy_plugin(struct plugin *p) |
|
|
static void destroy_plugin(struct plugin *p) |
|
|
{ |
|
|
{ |
|
|
plugin_hook_unregister_all(p); |
|
|
plugin_hook_unregister_all(p); |
|
|