Browse Source

jsonrpc: Remove `dev-blockheight` in favor of `getinfo`

`getinfo` has been providing the blockheight for a good while and doesn't
require the `DEVELOPER=1` flag during compilation, so it should be the preferred
method to retrieve the blockchain height.
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
582ea1a33b
  1. 6
      contrib/pylightning/lightning/lightning.py
  2. 20
      lightningd/chaintopology.c

6
contrib/pylightning/lightning/lightning.py

@ -105,12 +105,6 @@ class LightningRpc(UnixDomainSocketRpc):
res = self.call("listpeers", payload)
return res.get("peers") and res["peers"][0] or None
def dev_blockheight(self):
"""
Show current block height
"""
return self.call("dev-blockheight")
def dev_setfees(self, immediate=None, normal=None, slow=None):
"""
Set feerate in satoshi-per-kw for {immediate}, {normal} and {slow}

20
lightningd/chaintopology.c

@ -579,26 +579,6 @@ u32 get_feerate(const struct chain_topology *topo, enum feerate feerate)
}
#if DEVELOPER
static void json_dev_blockheight(struct command *cmd,
const char *buffer UNUSED, const jsmntok_t *params UNUSED)
{
struct chain_topology *topo = cmd->ld->topology;
struct json_result *response;
response = new_json_result(cmd);
json_object_start(response, NULL);
json_add_num(response, "blockheight", get_block_height(topo));
json_object_end(response);
command_success(cmd, response);
}
static const struct json_command dev_blockheight = {
"dev-blockheight",
json_dev_blockheight,
"Show current block height"
};
AUTODATA(json_command, &dev_blockheight);
static void json_dev_setfees(struct command *cmd,
const char *buffer, const jsmntok_t *params)
{

Loading…
Cancel
Save