Browse Source

gossip: make rpc responses correct.

It's not fee_per_kw, it's fee-per-millionth and a base in msatoshi.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
committed by Christian Decker
parent
commit
4be7e94e0b
  1. 3
      gossipd/gossip.c
  2. 5
      lightningd/gossip_control.c
  3. 6
      lightningd/gossip_msg.c
  4. 3
      lightningd/gossip_msg.h

3
gossipd/gossip.c

@ -573,7 +573,8 @@ static struct io_plan *getchannels_req(struct io_conn *conn, struct daemon *daem
entries[num_chans].short_channel_id = n->out[j]->short_channel_id;
entries[num_chans].last_update_timestamp = n->out[j]->last_timestamp;
if (entries[num_chans].last_update_timestamp >= 0) {
entries[num_chans].fee_per_kw = n->out[j]->proportional_fee;
entries[num_chans].base_fee_msat = n->out[j]->base_fee;
entries[num_chans].fee_per_millionth = n->out[j]->proportional_fee;
entries[num_chans].delay = n->out[j]->delay;
}
num_chans++;

5
lightningd/gossip_control.c

@ -310,7 +310,10 @@ static bool json_getchannels_reply(struct subd *gossip, const u8 *reply,
if (entries[i].last_update_timestamp >= 0) {
json_add_num(response, "last_update",
entries[i].last_update_timestamp);
json_add_num(response, "fee_per_kw", entries[i].fee_per_kw);
json_add_num(response, "base_fee_millisatoshi",
entries[i].base_fee_msat);
json_add_num(response, "fee_per_millionth",
entries[i].fee_per_millionth);
json_add_num(response, "delay", entries[i].delay);
}
json_object_end(response);

6
lightningd/gossip_msg.c

@ -48,7 +48,8 @@ void fromwire_gossip_getchannels_entry(const u8 **pptr, size_t *max,
entry->flags = fromwire_u16(pptr, max);
entry->last_update_timestamp = fromwire_u64(pptr, max);
if (entry->last_update_timestamp >= 0) {
entry->fee_per_kw = fromwire_u32(pptr, max);
entry->base_fee_msat = fromwire_u32(pptr, max);
entry->fee_per_millionth = fromwire_u32(pptr, max);
entry->delay = fromwire_u32(pptr, max);
}
}
@ -63,7 +64,8 @@ void towire_gossip_getchannels_entry(
towire_u16(pptr, entry->flags);
towire_u64(pptr, entry->last_update_timestamp);
if (entry->last_update_timestamp >= 0) {
towire_u32(pptr, entry->fee_per_kw);
towire_u32(pptr, entry->base_fee_msat);
towire_u32(pptr, entry->fee_per_millionth);
towire_u32(pptr, entry->delay);
}
}

3
lightningd/gossip_msg.h

@ -17,7 +17,8 @@ struct gossip_getchannels_entry {
s64 last_update_timestamp; /* -1 means never */
/* These are only set if last_update_timestamp >= 0 */
u32 delay;
u32 fee_per_kw;
u32 base_fee_msat;
u32 fee_per_millionth;
};
void fromwire_gossip_getnodes_entry(const tal_t *ctx, const u8 **pptr,

Loading…
Cancel
Save