mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
jsonrpc: Return the channel capacity for listchannels
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
2abf72e7df
commit
74a444eb7a
@ -1116,6 +1116,7 @@ static void append_half_channel(struct gossip_getchannels_entry **entries,
|
||||
|
||||
e->source = chan->nodes[idx]->id;
|
||||
e->destination = chan->nodes[!idx]->id;
|
||||
e->satoshis = chan->satoshis;
|
||||
e->active = c->active;
|
||||
e->flags = c->flags;
|
||||
e->public = (c->channel_update != NULL);
|
||||
|
@ -444,6 +444,7 @@ static void json_listchannels_reply(struct subd *gossip UNUSED, const u8 *reply,
|
||||
json_add_num(response, "flags", entries[i].flags);
|
||||
json_add_bool(response, "active", entries[i].active);
|
||||
json_add_bool(response, "public", entries[i].public);
|
||||
json_add_u64(response, "satoshis", entries[i].satoshis);
|
||||
if (entries[i].last_update_timestamp >= 0) {
|
||||
json_add_num(response, "last_update",
|
||||
entries[i].last_update_timestamp);
|
||||
|
@ -71,6 +71,7 @@ void fromwire_gossip_getchannels_entry(const u8 **pptr, size_t *max,
|
||||
fromwire_short_channel_id(pptr, max, &entry->short_channel_id);
|
||||
fromwire_pubkey(pptr, max, &entry->source);
|
||||
fromwire_pubkey(pptr, max, &entry->destination);
|
||||
entry->satoshis = fromwire_u64(pptr, max);
|
||||
entry->active = fromwire_bool(pptr, max);
|
||||
entry->flags = fromwire_u16(pptr, max);
|
||||
entry->public = fromwire_bool(pptr, max);
|
||||
@ -88,6 +89,7 @@ void towire_gossip_getchannels_entry(
|
||||
towire_short_channel_id(pptr, &entry->short_channel_id);
|
||||
towire_pubkey(pptr, &entry->source);
|
||||
towire_pubkey(pptr, &entry->destination);
|
||||
towire_u64(pptr, entry->satoshis);
|
||||
towire_bool(pptr, entry->active);
|
||||
towire_u16(pptr, entry->flags);
|
||||
towire_bool(pptr, entry->public);
|
||||
|
@ -14,6 +14,7 @@ struct gossip_getnodes_entry {
|
||||
|
||||
struct gossip_getchannels_entry {
|
||||
struct pubkey source, destination;
|
||||
u64 satoshis;
|
||||
bool active;
|
||||
struct short_channel_id short_channel_id;
|
||||
u16 flags;
|
||||
|
Loading…
Reference in New Issue
Block a user