Browse Source

gossip: remove short_channel_id from struct node_connection.

It's in the containing routing_channel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
172af04247
  1. 14
      gossipd/gossip.c
  2. 1
      gossipd/routing.c
  3. 4
      gossipd/routing.h
  4. 1
      gossipd/test/run-bench-find_route.c
  5. 1
      gossipd/test/run-find_route.c

14
gossipd/gossip.c

@ -1072,8 +1072,10 @@ static struct io_plan *getroute_req(struct io_conn *conn, struct daemon *daemon,
}
static void append_half_channel(struct gossip_getchannels_entry **entries,
const struct node_connection *c)
const struct routing_channel *chan,
int idx)
{
const struct node_connection *c = &chan->connections[idx];
struct gossip_getchannels_entry *e;
size_t n;
@ -1088,12 +1090,12 @@ static void append_half_channel(struct gossip_getchannels_entry **entries,
tal_resize(entries, n+1);
e = &(*entries)[n];
e->source = c->src->id;
e->destination = c->dst->id;
e->source = chan->nodes[idx]->id;
e->destination = chan->nodes[!idx]->id;
e->active = c->active;
e->flags = c->flags;
e->public = (c->channel_update != NULL);
e->short_channel_id = c->short_channel_id;
e->short_channel_id = chan->scid;
e->last_update_timestamp = c->channel_update ? c->last_timestamp : -1;
if (e->last_update_timestamp >= 0) {
e->base_fee_msat = c->base_fee;
@ -1105,8 +1107,8 @@ static void append_half_channel(struct gossip_getchannels_entry **entries,
static void append_channel(struct gossip_getchannels_entry **entries,
const struct routing_channel *chan)
{
append_half_channel(entries, &chan->connections[0]);
append_half_channel(entries, &chan->connections[1]);
append_half_channel(entries, chan, 0);
append_half_channel(entries, chan, 1);
}
static struct io_plan *getchannels_req(struct io_conn *conn, struct daemon *daemon,

1
gossipd/routing.c

@ -211,7 +211,6 @@ static void init_node_connection(struct routing_state *rstate,
c->src = from;
c->dst = to;
c->short_channel_id = chan->scid;
c->channel_update = NULL;
c->unroutable_until = 0;
c->active = false;

4
gossipd/routing.h

@ -31,10 +31,6 @@ struct node_connection {
/* Minimum number of msatoshi in an HTLC */
u32 htlc_minimum_msat;
/* The channel ID, as determined by the anchor transaction */
/* FIXME: Remove */
struct short_channel_id short_channel_id;
/* Flags as specified by the `channel_update`s, among other
* things indicated direction wrt the `channel_id` */
u16 flags;

1
gossipd/test/run-bench-find_route.c

@ -122,7 +122,6 @@ static struct node_connection *add_connection(struct routing_state *rstate,
c->proportional_fee = proportional_fee;
c->delay = delay;
c->active = true;
c->short_channel_id = scid;
c->flags = get_channel_direction(from, to);
return c;
}

1
gossipd/test/run-find_route.c

@ -87,7 +87,6 @@ static struct node_connection *add_connection(struct routing_state *rstate,
c->proportional_fee = proportional_fee;
c->delay = delay;
c->active = true;
c->short_channel_id = scid;
c->flags = get_channel_direction(from, to);
return c;
}

Loading…
Cancel
Save