mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 07:34:21 +01:00
lightningd: --deprecated-api option to turn off deprecated APIs.
This can be used for upgrades to make sure you're not using deprecated options, JSON commands, JSON fields, etc. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <lightningd/jsonrpc.h>
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/options.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -526,6 +527,13 @@ static void parse_request(struct json_connection *jcon, const jsmntok_t tok[])
|
||||
jcon->buffer + method->start);
|
||||
return;
|
||||
}
|
||||
if (cmd->deprecated && !deprecated_apis) {
|
||||
command_fail(jcon->current,
|
||||
"command '%.*s' is deprecated",
|
||||
(int)(method->end - method->start),
|
||||
jcon->buffer + method->start);
|
||||
return;
|
||||
}
|
||||
|
||||
if (params->type != JSMN_ARRAY && params->type != JSMN_OBJECT) {
|
||||
command_fail(jcon->current,
|
||||
|
||||
Reference in New Issue
Block a user