mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
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.
This commit is contained in:
parent
4a1b68502e
commit
582ea1a33b
@ -105,12 +105,6 @@ class LightningRpc(UnixDomainSocketRpc):
|
|||||||
res = self.call("listpeers", payload)
|
res = self.call("listpeers", payload)
|
||||||
return res.get("peers") and res["peers"][0] or None
|
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):
|
def dev_setfees(self, immediate=None, normal=None, slow=None):
|
||||||
"""
|
"""
|
||||||
Set feerate in satoshi-per-kw for {immediate}, {normal} and {slow}
|
Set feerate in satoshi-per-kw for {immediate}, {normal} and {slow}
|
||||||
|
@ -579,26 +579,6 @@ u32 get_feerate(const struct chain_topology *topo, enum feerate feerate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if DEVELOPER
|
#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,
|
static void json_dev_setfees(struct command *cmd,
|
||||||
const char *buffer, const jsmntok_t *params)
|
const char *buffer, const jsmntok_t *params)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user