Browse Source

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>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
d1c30c45ab
  1. 2
      daemon/jsonrpc.c

2
daemon/jsonrpc.c

@ -1,5 +1,6 @@
/* Code for JSON_RPC API */ /* Code for JSON_RPC API */
/* eg: { "method" : "dev-echo", "params" : [ "hello", "Arabella!" ], "id" : "1" } */ /* eg: { "method" : "dev-echo", "params" : [ "hello", "Arabella!" ], "id" : "1" } */
#include "chaintopology.h"
#include "controlled_time.h" #include "controlled_time.h"
#include "json.h" #include "json.h"
#include "jsonrpc.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_num(response, "port", cmd->dstate->portnum);
json_add_bool(response, "testnet", cmd->dstate->testnet); json_add_bool(response, "testnet", cmd->dstate->testnet);
json_add_string(response, "version", version()); json_add_string(response, "version", version());
json_add_num(response, "blockheight", get_block_height(cmd->dstate));
json_object_end(response); json_object_end(response);
command_success(cmd, response); command_success(cmd, response);
} }

Loading…
Cancel
Save