diff --git a/plugins/libplugin.c b/plugins/libplugin.c index db49590d6..8dfba2ce5 100644 --- a/plugins/libplugin.c +++ b/plugins/libplugin.c @@ -1302,6 +1302,19 @@ handle_getmanifest(struct command *getmanifest_cmd, p->hook_subs[i].after[j]); json_array_end(params); } + if (p->hook_subs[i].num_strfilters) { + json_array_start(params, "filters"); + for (size_t j = 0; j < p->hook_subs[i].num_strfilters; j++) + json_add_string(params, NULL, + p->hook_subs[i].strfilters[j]); + json_array_end(params); + } else if (p->hook_subs[i].num_intfilters) { + json_array_start(params, "filters"); + for (size_t j = 0; j < p->hook_subs[i].num_intfilters; j++) + json_add_u64(params, NULL, + p->hook_subs[i].intfilters[j]); + json_array_end(params); + } json_object_end(params); } json_array_end(params); diff --git a/plugins/libplugin.h b/plugins/libplugin.h index cec028b2f..bcc68dc03 100644 --- a/plugins/libplugin.h +++ b/plugins/libplugin.h @@ -99,6 +99,14 @@ struct plugin_hook { const jsmntok_t *params); /* If non-NULL, these are NULL-terminated arrays of deps */ const char **before, **after; + + /* String filters (you can only set this *or* intfilters) */ + const char **strfilters; + size_t num_strfilters; + + /* Integer filters */ + const u64 *intfilters; + size_t num_intfilters; }; /* Return the feature set of the current lightning node */