Browse Source

jsonrpc: Return the channel capacity for listchannels

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
74a444eb7a
  1. 1
      gossipd/gossip.c
  2. 1
      lightningd/gossip_control.c
  3. 2
      lightningd/gossip_msg.c
  4. 1
      lightningd/gossip_msg.h

1
gossipd/gossip.c

@ -1116,6 +1116,7 @@ static void append_half_channel(struct gossip_getchannels_entry **entries,
e->source = chan->nodes[idx]->id; e->source = chan->nodes[idx]->id;
e->destination = chan->nodes[!idx]->id; e->destination = chan->nodes[!idx]->id;
e->satoshis = chan->satoshis;
e->active = c->active; e->active = c->active;
e->flags = c->flags; e->flags = c->flags;
e->public = (c->channel_update != NULL); e->public = (c->channel_update != NULL);

1
lightningd/gossip_control.c

@ -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_num(response, "flags", entries[i].flags);
json_add_bool(response, "active", entries[i].active); json_add_bool(response, "active", entries[i].active);
json_add_bool(response, "public", entries[i].public); json_add_bool(response, "public", entries[i].public);
json_add_u64(response, "satoshis", entries[i].satoshis);
if (entries[i].last_update_timestamp >= 0) { if (entries[i].last_update_timestamp >= 0) {
json_add_num(response, "last_update", json_add_num(response, "last_update",
entries[i].last_update_timestamp); entries[i].last_update_timestamp);

2
lightningd/gossip_msg.c

@ -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_short_channel_id(pptr, max, &entry->short_channel_id);
fromwire_pubkey(pptr, max, &entry->source); fromwire_pubkey(pptr, max, &entry->source);
fromwire_pubkey(pptr, max, &entry->destination); fromwire_pubkey(pptr, max, &entry->destination);
entry->satoshis = fromwire_u64(pptr, max);
entry->active = fromwire_bool(pptr, max); entry->active = fromwire_bool(pptr, max);
entry->flags = fromwire_u16(pptr, max); entry->flags = fromwire_u16(pptr, max);
entry->public = fromwire_bool(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_short_channel_id(pptr, &entry->short_channel_id);
towire_pubkey(pptr, &entry->source); towire_pubkey(pptr, &entry->source);
towire_pubkey(pptr, &entry->destination); towire_pubkey(pptr, &entry->destination);
towire_u64(pptr, entry->satoshis);
towire_bool(pptr, entry->active); towire_bool(pptr, entry->active);
towire_u16(pptr, entry->flags); towire_u16(pptr, entry->flags);
towire_bool(pptr, entry->public); towire_bool(pptr, entry->public);

1
lightningd/gossip_msg.h

@ -14,6 +14,7 @@ struct gossip_getnodes_entry {
struct gossip_getchannels_entry { struct gossip_getchannels_entry {
struct pubkey source, destination; struct pubkey source, destination;
u64 satoshis;
bool active; bool active;
struct short_channel_id short_channel_id; struct short_channel_id short_channel_id;
u16 flags; u16 flags;

Loading…
Cancel
Save