diff --git a/lightningd/channel.h b/lightningd/channel.h index 7e5e18464..c11eea904 100644 --- a/lightningd/channel.h +++ b/lightningd/channel.h @@ -125,7 +125,7 @@ static inline u16 to_self_delay(const struct channel *channel, enum side side) * @funding_txout: The commitment transaction output number. * @funding_satoshis: The commitment transaction amount. * @local_msatoshi: The amount for the local side (remainder goes to remote) - * @feerate_per_kw: feerate per kiloweight (satoshis) + * @feerate_per_kw: feerate per kiloweight (satoshis) for the settlement transaction * @local: local channel configuration * @remote: remote channel configuration * @local_basepoints: local basepoints. diff --git a/lightningd/channel/channel.c b/lightningd/channel/channel.c index 09ae8bf3d..94343686f 100644 --- a/lightningd/channel/channel.c +++ b/lightningd/channel/channel.c @@ -1617,12 +1617,14 @@ static void init_channel(struct peer *peer) bool reconnected; u8 *funding_signed; u8 *msg; + u32 feerate_per_kw; msg = wire_sync_read(peer, REQ_FD); if (!fromwire_channel_init(peer, msg, NULL, &funding_txid, &funding_txout, &funding_satoshi, &peer->conf[LOCAL], &peer->conf[REMOTE], + &feerate_per_kw, &peer->their_commit_sig, &peer->pcs.cs, &funding_pubkey[REMOTE], @@ -1689,7 +1691,7 @@ static void init_channel(struct peer *peer) peer->channel = new_channel(peer, &funding_txid, funding_txout, funding_satoshi, local_msatoshi, - peer->fee_base, + feerate_per_kw, &peer->conf[LOCAL], &peer->conf[REMOTE], &points[LOCAL], &points[REMOTE], &funding_pubkey[LOCAL], diff --git a/lightningd/channel/channel_wire.csv b/lightningd/channel/channel_wire.csv index 5ff37483e..0a94a6b29 100644 --- a/lightningd/channel/channel_wire.csv +++ b/lightningd/channel/channel_wire.csv @@ -27,6 +27,7 @@ channel_init,,funding_txout,2 channel_init,,funding_satoshi,8 channel_init,,our_config,struct channel_config channel_init,,their_config,struct channel_config +channel_init,,feerate_per_kw,4 channel_init,,first_commit_sig,secp256k1_ecdsa_signature channel_init,,crypto_state,struct crypto_state channel_init,,remote_fundingkey,33 diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 9c7057517..c0d003f37 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -1196,6 +1196,7 @@ static bool peer_start_channeld(struct peer *peer, peer->funding_satoshi, &peer->our_config, &peer->channel_info->their_config, + peer->channel_info->feerate_per_kw, &peer->channel_info->commit_sig, cs, &peer->channel_info->remote_fundingkey,