plugin: Add a list of notification topics registered by plugin

We will eventually start emitting and dispatching custom notifications
from plugins just like we dispatch internal notifications. In order to
get reasonable error messages we need to make sure that the topics
plugins are asking for were correctly registered. When doing this we
don't really care about whether the plugin that registered the
notification is still alive or not (it might have died, but
subscribers should stay up and running), so we keep a list of all
topics attached to the `struct plugins` which gathers global plugin
information.
This commit is contained in:
Christian Decker
2021-04-27 15:15:09 +02:00
committed by Rusty Russell
parent 29155c2fe8
commit 083b41f090
7 changed files with 80 additions and 9 deletions

View File

@@ -128,6 +128,10 @@ struct plugins {
/* Whether builtin plugins should be overridden as unimportant. */
bool dev_builtin_plugins_unimportant;
#endif /* DEVELOPER */
/* Notification topics that plugins have registered with us
* and that other plugins may subscribe to. */
const char **notification_topics;
};
/* The value of a plugin option, which can have different types.