Browse Source

channeld: get local peer features from lightningd.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
plugin-6
Rusty Russell 6 years ago
parent
commit
881c3893e6
  1. 2
      channeld/channel_wire.csv
  2. 6
      channeld/channeld.c
  3. 3
      lightningd/channel_control.c

2
channeld/channel_wire.csv

@ -59,6 +59,8 @@ channel_init,,init_peer_pkt_len,u16
channel_init,,init_peer_pkt,init_peer_pkt_len*u8
channel_init,,reached_announce_depth,bool
channel_init,,last_remote_secret,struct secret
channel_init,,lflen,u16
channel_init,,localfeatures,lflen*u8
# master->channeld funding hit new depth >= lock depth
channel_funding_locked,1002

Can't render this file because it has a wrong number of fields in line 6.

6
channeld/channeld.c

@ -68,6 +68,9 @@ struct peer {
bool funding_locked[NUM_SIDES];
u64 next_index[NUM_SIDES];
/* Features peer supports. */
u8 *localfeatures;
/* Tolerable amounts for feerate (only relevant for fundee). */
u32 feerate_min, feerate_max;
@ -2654,7 +2657,8 @@ static void init_channel(struct peer *peer)
&peer->channel_flags,
&funding_signed,
&peer->announce_depth_reached,
&last_remote_per_commit_secret))
&last_remote_per_commit_secret,
&peer->localfeatures))
master_badmsg(WIRE_CHANNEL_INIT, msg);
status_trace("init %s: remote_per_commit = %s, old_remote_per_commit = %s"

3
lightningd/channel_control.c

@ -381,7 +381,8 @@ void peer_start_channeld(struct channel *channel,
channel->channel_flags,
funding_signed,
reached_announce_depth,
&last_remote_per_commit_secret);
&last_remote_per_commit_secret,
channel->peer->localfeatures);
/* We don't expect a response: we are triggered by funding_depth_cb. */
subd_send_msg(channel->owner, take(initmsg));

Loading…
Cancel
Save