mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
libplugin: add deprecated_apis flag for plugins to access.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -25,6 +25,8 @@ static u64 next_outreq_id;
|
|||||||
* struct json_command as it's good practice to have those const. */
|
* struct json_command as it's good practice to have those const. */
|
||||||
static STRMAP(const char *) usagemap;
|
static STRMAP(const char *) usagemap;
|
||||||
|
|
||||||
|
bool deprecated_apis;
|
||||||
|
|
||||||
struct plugin_conn {
|
struct plugin_conn {
|
||||||
int fd;
|
int fd;
|
||||||
MEMBUF(char) mb;
|
MEMBUF(char) mb;
|
||||||
@@ -472,6 +474,12 @@ static struct command_result *handle_init(struct command *init_cmd,
|
|||||||
rpctok->end - rpctok->start, buf + rpctok->start,
|
rpctok->end - rpctok->start, buf + rpctok->start,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
|
||||||
|
deprecated_apis = streq(rpc_delve(tmpctx, "listconfigs",
|
||||||
|
"'config': 'allow-deprecated-apis'",
|
||||||
|
init_cmd->rpc,
|
||||||
|
".allow-deprecated-apis"),
|
||||||
|
"true");
|
||||||
|
|
||||||
if (init)
|
if (init)
|
||||||
init(init_cmd->rpc);
|
init(init_cmd->rpc);
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
struct command;
|
struct command;
|
||||||
struct plugin_conn;
|
struct plugin_conn;
|
||||||
|
|
||||||
|
extern bool deprecated_apis;
|
||||||
|
|
||||||
/* Create an array of these, one for each command you support. */
|
/* Create an array of these, one for each command you support. */
|
||||||
struct plugin_command {
|
struct plugin_command {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|||||||
Reference in New Issue
Block a user