plugin: sort topological candidates by specified order.

We previously registered hooks up in who-replies-to-getmanifest-first
order, but then if any had dependencies it would scatter that order.

This allows users to manually set dependencies developers have
forgotten by specifying the plugins manually in their configuration or
cmdline.  This was an excellent consideration by @mschmook.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-11-03 09:50:52 +10:30
committed by neil saitug
parent d429e21db3
commit fb295ffb51
7 changed files with 66 additions and 66 deletions

View File

@@ -50,6 +50,9 @@ struct plugin {
enum plugin_state plugin_state;
/* Our unique index, which is default hook ordering. */
u64 index;
/* If this plugin can be restarted without restarting lightningd */
bool dynamic;
@@ -113,6 +116,9 @@ struct plugins {
/* Whether we are shutting down (`plugins_free` is called) */
bool shutdown;
/* Index to show what order they were added in */
u64 plugin_idx;
#if DEVELOPER
/* Whether builtin plugins should be overridden as unimportant. */
bool dev_builtin_plugins_unimportant;