diff --git a/lightningd/Makefile b/lightningd/Makefile index 3ce06d2f7..cd60db562 100644 --- a/lightningd/Makefile +++ b/lightningd/Makefile @@ -78,7 +78,8 @@ ALL_OBJS += $(LIGHTNINGD_OBJS) # We accumulate all lightningd/ headers in these three: LIGHTNINGD_HEADERS_NOGEN = \ $(LIGHTNINGD_SRC:.c=.h) \ - lightningd/peer_state.h + lightningd/peer_state.h \ + lightningd/jsonrpc_errors.h # Generated headers LIGHTNINGD_HEADERS_GEN = \ diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 99a076854..6cd62c33b 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -470,10 +471,6 @@ void json_add_address(struct json_result *response, const char *fieldname, json_object_end(response); } -#define JSONRPC2_INVALID_REQUEST -32600 -#define JSONRPC2_METHOD_NOT_FOUND -32601 -#define JSONRPC2_INVALID_PARAMS -32602 - void command_success(struct command *cmd, struct json_result *result) { struct json_connection *jcon = cmd->jcon; diff --git a/lightningd/jsonrpc_errors.h b/lightningd/jsonrpc_errors.h new file mode 100644 index 000000000..46d7b381f --- /dev/null +++ b/lightningd/jsonrpc_errors.h @@ -0,0 +1,13 @@ +/* lightningd/jsonrpc_errors.h + * Lists error codes for JSON-RPC. + */ +#ifndef LIGHTNING_LIGHTNINGD_JSONRPC_ERRORS_H +#define LIGHTNING_LIGHTNINGD_JSONRPC_ERRORS_H +#include "config.h" + +/* Standad errors defined by JSON-RPC 2.0 standard */ +#define JSONRPC2_INVALID_REQUEST -32600 +#define JSONRPC2_METHOD_NOT_FOUND -32601 +#define JSONRPC2_INVALID_PARAMS -32602 + +#endif /* !defined (LIGHTNING_LIGHTNINGD_JSONRPC_ERRORS_H) */