mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-08 23:54:20 +01:00
getinfo: show block height.
My lightning node was *way* behind, and I couldn't figure out why it wasn't seeing channel establishment. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/* Code for JSON_RPC API */
|
||||
/* eg: { "method" : "dev-echo", "params" : [ "hello", "Arabella!" ], "id" : "1" } */
|
||||
#include "chaintopology.h"
|
||||
#include "controlled_time.h"
|
||||
#include "json.h"
|
||||
#include "jsonrpc.h"
|
||||
@@ -268,6 +269,7 @@ static void json_getinfo(struct command *cmd,
|
||||
json_add_num(response, "port", cmd->dstate->portnum);
|
||||
json_add_bool(response, "testnet", cmd->dstate->testnet);
|
||||
json_add_string(response, "version", version());
|
||||
json_add_num(response, "blockheight", get_block_height(cmd->dstate));
|
||||
json_object_end(response);
|
||||
command_success(cmd, response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user