mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-27 01:34:20 +01:00
plugin: Add a status field to htlcs in listpeers
Annotating the htlc in `listpeers` with their current status, and which plugin is currently holding on to them with their `htlc_accepted` hook can help us debug where plugins may go wrong. Changelog-Added: jsonrpc: HTLCs in `listpeers` are now annotated with a status if they are waiting on an `htlc_accepted` hook of a plugin.
This commit is contained in:
committed by
Rusty Russell
parent
a503032bab
commit
610d8a0a74
@@ -505,6 +505,8 @@ static void json_add_htlcs(struct lightningd *ld,
|
||||
channel->our_config.dust_limit, LOCAL,
|
||||
channel->option_anchor_outputs))
|
||||
json_add_bool(response, "local_trimmed", true);
|
||||
if (hin->status != NULL)
|
||||
json_add_string(response, "status", hin->status);
|
||||
json_object_end(response);
|
||||
}
|
||||
|
||||
|
||||
@@ -1015,8 +1015,14 @@ static void htlc_accepted_hook_serialize(struct htlc_accepted_hook_payload *p,
|
||||
struct plugin *plugin)
|
||||
{
|
||||
const struct route_step *rs = p->route_step;
|
||||
const struct htlc_in *hin = p->hin;
|
||||
struct htlc_in *hin = p->hin;
|
||||
s32 expiry = hin->cltv_expiry, blockheight = p->ld->topology->tip->height;
|
||||
|
||||
tal_free(hin->status);
|
||||
hin->status =
|
||||
tal_fmt(hin, "Waiting for the htlc_accepted hook of plugin %s",
|
||||
plugin->shortname);
|
||||
|
||||
json_object_start(s, "onion");
|
||||
|
||||
json_add_hex_talarr(s, "payload", rs->raw_payload);
|
||||
|
||||
Reference in New Issue
Block a user