diff --git a/gossipd/gossip.c b/gossipd/gossip.c index c94a884ef..0e1629628 100644 --- a/gossipd/gossip.c +++ b/gossipd/gossip.c @@ -1818,7 +1818,7 @@ static struct io_plan *handle_txout_reply(struct io_conn *conn, if (!fromwire_gossip_get_txout_reply(msg, msg, &scid, &satoshis, &outscript)) master_badmsg(WIRE_GOSSIP_GET_TXOUT_REPLY, msg); - if (handle_pending_cannouncement(daemon->rstate, &scid, outscript)) + if (handle_pending_cannouncement(daemon->rstate, &scid, satoshis, outscript)) send_node_announcement(daemon); return daemon_conn_read_next(conn, &daemon->master); diff --git a/gossipd/routing.c b/gossipd/routing.c index 336ec9f51..97969f470 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -225,6 +225,7 @@ struct chan *new_chan(struct routing_state *rstate, chan->channel_announcement = NULL; chan->channel_announce_msgidx = 0; chan->public = false; + chan->satoshis = 0; n = tal_count(n2->chans); tal_resize(&n2->chans, n+1); @@ -646,6 +647,7 @@ const struct short_channel_id *handle_channel_announcement( bool handle_pending_cannouncement(struct routing_state *rstate, const struct short_channel_id *scid, + const u64 satoshis, const u8 *outscript) { bool local; @@ -706,6 +708,7 @@ bool handle_pending_cannouncement(struct routing_state *rstate, /* Channel is now public. */ chan->public = true; + chan->satoshis = satoshis; /* Save channel_announcement. */ tal_free(chan->channel_announcement); diff --git a/gossipd/routing.h b/gossipd/routing.h index ce476c8fc..de3b00bed 100644 --- a/gossipd/routing.h +++ b/gossipd/routing.h @@ -61,6 +61,8 @@ struct chan { /* Is this a public channel, or was it only added locally? */ bool public; + + u64 satoshis; }; struct node { @@ -210,6 +212,7 @@ handle_channel_announcement(struct routing_state *rstate, */ bool handle_pending_cannouncement(struct routing_state *rstate, const struct short_channel_id *scid, + const u64 satoshis, const u8 *txscript); void handle_channel_update(struct routing_state *rstate, const u8 *update); void handle_node_announcement(struct routing_state *rstate, const u8 *node);