mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightning-cli: add jsonrpc version to cmd json packet
Plugins expect jsonrpc commands to include the version, so let's include it.
This commit is contained in:
committed by
Christian Decker
parent
bcde9675e4
commit
b2ee53fd89
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
- JSON API: `pay` and `decodepay` accept and ignore `lightning:` prefixes.
|
- JSON API: `pay` and `decodepay` accept and ignore `lightning:` prefixes.
|
||||||
- pylightning: Allow either keyword arguments or positional arguments.
|
- pylightning: Allow either keyword arguments or positional arguments.
|
||||||
- JSON-RPC: messages are now separated by 2 consecutive newlines.
|
- JSON-RPC: messages are now separated by 2 consecutive newlines.
|
||||||
|
- JSON-RPC: `jsonrpc`:`2.0` now included in json-rpc command calls. complies with spec.
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
idstr = tal_fmt(ctx, "lightning-cli-%i", getpid());
|
idstr = tal_fmt(ctx, "lightning-cli-%i", getpid());
|
||||||
cmd = tal_fmt(ctx,
|
cmd = tal_fmt(ctx,
|
||||||
"{ \"method\" : \"%s\", \"id\" : \"%s\", \"params\" : ",
|
"{ \"jsonrpc\" : \"2.0\", \"method\" : \"%s\", \"id\" : \"%s\", \"params\" :",
|
||||||
method, idstr);
|
method, idstr);
|
||||||
|
|
||||||
if (input == DEFAULT_INPUT) {
|
if (input == DEFAULT_INPUT) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* done, the `json_connection` needs to drain it (if it's still around). At
|
* done, the `json_connection` needs to drain it (if it's still around). At
|
||||||
* that point, the `json_connection` becomes the owner (or it's simply freed).
|
* that point, the `json_connection` becomes the owner (or it's simply freed).
|
||||||
*/
|
*/
|
||||||
/* eg: { "method" : "dev-echo", "params" : [ "hello", "Arabella!" ], "id" : "1" } */
|
/* eg: { "jsonrpc":"2.0", "method" : "dev-echo", "params" : [ "hello", "Arabella!" ], "id" : "1" } */
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <bitcoin/address.h>
|
#include <bitcoin/address.h>
|
||||||
#include <bitcoin/base58.h>
|
#include <bitcoin/base58.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user