Skip to content

Commit

Permalink
libplugin: add deprecated_apis flag for plugins to access.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Feb 23, 2019
1 parent 30e4b81 commit 26f60f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/libplugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ static u64 next_outreq_id;
* struct json_command as it's good practice to have those const. */
static STRMAP(const char *) usagemap;

bool deprecated_apis;

struct plugin_conn {
int fd;
MEMBUF(char) mb;
Expand Down Expand Up @@ -472,6 +474,12 @@ static struct command_result *handle_init(struct command *init_cmd,
rpctok->end - rpctok->start, buf + rpctok->start,
strerror(errno));

deprecated_apis = streq(rpc_delve(tmpctx, "listconfigs",
"'config': 'allow-deprecated-apis'",
init_cmd->rpc,
".allow-deprecated-apis"),
"true");

if (init)
init(init_cmd->rpc);

Expand Down
2 changes: 2 additions & 0 deletions plugins/libplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
struct command;
struct plugin_conn;

extern bool deprecated_apis;

/* Create an array of these, one for each command you support. */
struct plugin_command {
const char *name;
Expand Down

0 comments on commit 26f60f8

Please sign in to comment.