mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 16:14:26 +01:00
[rpc] Add funding allocation to listpeers command
This commit is contained in:
@@ -720,6 +720,21 @@ static void json_add_peer(struct lightningd *ld,
|
||||
&channel->funding_txid);
|
||||
json_add_bool(response, "private",
|
||||
!(channel->channel_flags & CHANNEL_FLAGS_ANNOUNCE_CHANNEL));
|
||||
|
||||
// FIXME @conscott : Modify this when dual-funded channels
|
||||
// are implemented
|
||||
json_object_start(response, "funding_allocation_msat");
|
||||
if (channel->funder == LOCAL) {
|
||||
json_add_u64(response, pubkey_to_hexstr(tmpctx, &p->id), 0);
|
||||
json_add_u64(response, pubkey_to_hexstr(tmpctx, &ld->id),
|
||||
channel->funding_satoshi * 1000);
|
||||
} else {
|
||||
json_add_u64(response, pubkey_to_hexstr(tmpctx, &ld->id), 0);
|
||||
json_add_u64(response, pubkey_to_hexstr(tmpctx, &p->id),
|
||||
channel->funding_satoshi * 1000);
|
||||
}
|
||||
json_object_end(response);
|
||||
|
||||
json_add_u64(response, "msatoshi_to_us",
|
||||
channel->our_msatoshi);
|
||||
json_add_u64(response, "msatoshi_to_us_min",
|
||||
|
||||
Reference in New Issue
Block a user