Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions contrib/pylightning/lightning/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def __init__(self, stdout=None, stdin=None, autopatch=True, dynamic=True):
if not stdin:
self.stdin = sys.stdin

self.lightning_version = None
if os.getenv('LIGHTNINGD_VERSION'):
self.lightning_version = os.getenv('LIGHTNINGD_VERSION')
if os.getenv('LIGHTNINGD_PLUGIN') and autopatch:
monkey_patch(self, stdout=True, stderr=True)

Expand Down
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);
Comment thread
This conversation was marked as resolved.
setenv("LIGHTNINGD_VERSION", version(), 1);
/* Spawn the plugin processes before entering the io_loop */
plugins_start(plugins, dev_plugin_debug);

Expand Down