mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
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>
This commit is contained in:
parent
21b2f37dfb
commit
172af04247
5 changed files with 8 additions and 13 deletions
|
@ -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,
|
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;
|
struct gossip_getchannels_entry *e;
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
|
@ -1088,12 +1090,12 @@ static void append_half_channel(struct gossip_getchannels_entry **entries,
|
||||||
tal_resize(entries, n+1);
|
tal_resize(entries, n+1);
|
||||||
e = &(*entries)[n];
|
e = &(*entries)[n];
|
||||||
|
|
||||||
e->source = c->src->id;
|
e->source = chan->nodes[idx]->id;
|
||||||
e->destination = c->dst->id;
|
e->destination = chan->nodes[!idx]->id;
|
||||||
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);
|
||||||
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;
|
e->last_update_timestamp = c->channel_update ? c->last_timestamp : -1;
|
||||||
if (e->last_update_timestamp >= 0) {
|
if (e->last_update_timestamp >= 0) {
|
||||||
e->base_fee_msat = c->base_fee;
|
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,
|
static void append_channel(struct gossip_getchannels_entry **entries,
|
||||||
const struct routing_channel *chan)
|
const struct routing_channel *chan)
|
||||||
{
|
{
|
||||||
append_half_channel(entries, &chan->connections[0]);
|
append_half_channel(entries, chan, 0);
|
||||||
append_half_channel(entries, &chan->connections[1]);
|
append_half_channel(entries, chan, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct io_plan *getchannels_req(struct io_conn *conn, struct daemon *daemon,
|
static struct io_plan *getchannels_req(struct io_conn *conn, struct daemon *daemon,
|
||||||
|
|
|
@ -211,7 +211,6 @@ static void init_node_connection(struct routing_state *rstate,
|
||||||
|
|
||||||
c->src = from;
|
c->src = from;
|
||||||
c->dst = to;
|
c->dst = to;
|
||||||
c->short_channel_id = chan->scid;
|
|
||||||
c->channel_update = NULL;
|
c->channel_update = NULL;
|
||||||
c->unroutable_until = 0;
|
c->unroutable_until = 0;
|
||||||
c->active = false;
|
c->active = false;
|
||||||
|
|
|
@ -31,10 +31,6 @@ struct node_connection {
|
||||||
/* Minimum number of msatoshi in an HTLC */
|
/* Minimum number of msatoshi in an HTLC */
|
||||||
u32 htlc_minimum_msat;
|
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
|
/* Flags as specified by the `channel_update`s, among other
|
||||||
* things indicated direction wrt the `channel_id` */
|
* things indicated direction wrt the `channel_id` */
|
||||||
u16 flags;
|
u16 flags;
|
||||||
|
|
|
@ -122,7 +122,6 @@ static struct node_connection *add_connection(struct routing_state *rstate,
|
||||||
c->proportional_fee = proportional_fee;
|
c->proportional_fee = proportional_fee;
|
||||||
c->delay = delay;
|
c->delay = delay;
|
||||||
c->active = true;
|
c->active = true;
|
||||||
c->short_channel_id = scid;
|
|
||||||
c->flags = get_channel_direction(from, to);
|
c->flags = get_channel_direction(from, to);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,6 @@ static struct node_connection *add_connection(struct routing_state *rstate,
|
||||||
c->proportional_fee = proportional_fee;
|
c->proportional_fee = proportional_fee;
|
||||||
c->delay = delay;
|
c->delay = delay;
|
||||||
c->active = true;
|
c->active = true;
|
||||||
c->short_channel_id = scid;
|
|
||||||
c->flags = get_channel_direction(from, to);
|
c->flags = get_channel_direction(from, to);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue