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:
Rusty Russell
2016-10-07 14:01:18 +10:30
parent f66358882a
commit d1c30c45ab

View File

@@ -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);
}