Skip to content

Commit 13218f6

Browse files
committed
feat: adds local halfchan fees to listpeers
This will add `fee_base` (msat) and `fee_ppm` (u32 num) to the RPC `listpeers` output. Changelog-Added: fee_base and fee_ppm to listpeers
1 parent 7514d7f commit 13218f6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lightningd/peer_control.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,12 @@ static void json_add_channel(struct lightningd *ld,
877877
json_add_amount_msat_compat(response, funding_msat,
878878
"msatoshi_total", "total_msat");
879879

880+
/* routing fees */
881+
json_add_amount_msat_only(response, "fee_base_msat",
882+
amount_msat(channel->feerate_base));
883+
json_add_u32(response, "fee_proportional_millionths",
884+
channel->feerate_ppm);
885+
880886
/* channel config */
881887
json_add_amount_sat_compat(response,
882888
channel->our_config.dust_limit,

lightningd/test/run-invoice-select-inchan.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ void json_add_amount_msat_compat(struct json_stream *result UNNEEDED,
224224
const char *msatfieldname)
225225

226226
{ fprintf(stderr, "json_add_amount_msat_compat called!\n"); abort(); }
227+
/* Generated stub for json_add_amount_msat_only */
228+
void json_add_amount_msat_only(struct json_stream *result UNNEEDED,
229+
const char *msatfieldname UNNEEDED,
230+
struct amount_msat msat)
231+
232+
{ fprintf(stderr, "json_add_amount_msat_only called!\n"); abort(); }
227233
/* Generated stub for json_add_amount_sat_compat */
228234
void json_add_amount_sat_compat(struct json_stream *result UNNEEDED,
229235
struct amount_sat sat UNNEEDED,

0 commit comments

Comments
 (0)