listincoming: add htlc_min_msat, public and peer_features fields.

This is needed for offers to generate blinded paths.

No documentation changes since listincoming is an undocumented
internal hack interface which topology presents for production
of routehints.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-11-09 13:01:59 +10:30
committed by Christian Decker
parent c6f50220e1
commit 4bc10579e6
3 changed files with 35 additions and 3 deletions

View File

@@ -577,6 +577,7 @@ static struct command_result *json_listincoming(struct command *cmd,
struct gossmap_chan *ourchan;
struct gossmap_node *peer;
struct short_channel_id scid;
const u8 *peer_features;
ourchan = gossmap_nth_chan(gossmap, me, i, &dir);
/* If its half is disabled, ignore. */
@@ -593,6 +594,9 @@ static struct command_result *json_listincoming(struct command *cmd,
json_add_amount_msat_only(js, "fee_base_msat",
amount_msat(ourchan->half[!dir]
.base_fee));
json_add_amount_msat_only(js, "htlc_min_msat",
amount_msat(fp16_to_u64(ourchan->half[!dir]
.htlc_min)));
json_add_amount_msat_only(js, "htlc_max_msat",
amount_msat(fp16_to_u64(ourchan->half[!dir]
.htlc_max)));
@@ -602,6 +606,10 @@ static struct command_result *json_listincoming(struct command *cmd,
json_add_amount_msat_only(js, "incoming_capacity_msat",
peer_capacity(gossmap,
me, peer, ourchan));
json_add_bool(js, "public", !ourchan->private);
peer_features = gossmap_node_get_features(tmpctx, gossmap, peer);
if (peer_features)
json_add_hex_talarr(js, "peer_features", peer_features);
json_object_end(js);
}
done: