Skip to content

Commit

Permalink
lightningd/plugin: at plugin start, set env LIGHTNINGD_VERSION
Browse files Browse the repository at this point in the history
So plugins can know what version they are dealing with.
  • Loading branch information
SimonVrouwe authored and niftynei committed Aug 26, 2019
1 parent 9dd3142 commit da74f01
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lightningd/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <common/memleak.h>
#include <common/param.h>
#include <common/timeout.h>
#include <common/version.h>
#include <dirent.h>
#include <errno.h>
#include <lightningd/io_loop_with_timers.h>
Expand Down Expand Up @@ -1012,6 +1013,7 @@ void plugins_init(struct plugins *plugins, const char *dev_plugin_debug)
path_join(tmpctx, plugins->ld->config_dir, "plugins"));

setenv("LIGHTNINGD_PLUGIN", "1", 1);
setenv("LIGHTNINGD_VERSION", version(), 1);
/* Spawn the plugin processes before entering the io_loop */
plugins_start(plugins, dev_plugin_debug);

Expand Down

0 comments on commit da74f01

Please sign in to comment.