channeld: get local peer features from lightningd.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-12-10 11:33:42 +10:30
parent 981b000949
commit 881c3893e6
3 changed files with 9 additions and 2 deletions

View File

@@ -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
1 #include <common/cryptomsg.h>
59 channel_init,,reached_announce_depth,bool
60 channel_init,,last_remote_secret,struct secret
61 # master->channeld funding hit new depth >= lock depth channel_init,,lflen,u16
62 channel_init,,localfeatures,lflen*u8
63 # master->channeld funding hit new depth >= lock depth
64 channel_funding_locked,1002
65 channel_funding_locked,,short_channel_id,struct short_channel_id
66 channel_funding_locked,,depth,u32

View File

@@ -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"

View File

@@ -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));