Browse Source

channeld: Pass through the agreed feerate_per_kw to channeld

We were erroneously using the fee_base which refers to the fees we
require for forwarding transactions instead of the on-chain fees.
ppa-0.6.1
Christian Decker 8 years ago
committed by Rusty Russell
parent
commit
70f4484ba8
  1. 2
      lightningd/channel.h
  2. 4
      lightningd/channel/channel.c
  3. 1
      lightningd/channel/channel_wire.csv
  4. 1
      lightningd/peer_control.c

2
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_txout: The commitment transaction output number.
* @funding_satoshis: The commitment transaction amount. * @funding_satoshis: The commitment transaction amount.
* @local_msatoshi: The amount for the local side (remainder goes to remote) * @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 * @local: local channel configuration
* @remote: remote channel configuration * @remote: remote channel configuration
* @local_basepoints: local basepoints. * @local_basepoints: local basepoints.

4
lightningd/channel/channel.c

@ -1617,12 +1617,14 @@ static void init_channel(struct peer *peer)
bool reconnected; bool reconnected;
u8 *funding_signed; u8 *funding_signed;
u8 *msg; u8 *msg;
u32 feerate_per_kw;
msg = wire_sync_read(peer, REQ_FD); msg = wire_sync_read(peer, REQ_FD);
if (!fromwire_channel_init(peer, msg, NULL, if (!fromwire_channel_init(peer, msg, NULL,
&funding_txid, &funding_txout, &funding_txid, &funding_txout,
&funding_satoshi, &funding_satoshi,
&peer->conf[LOCAL], &peer->conf[REMOTE], &peer->conf[LOCAL], &peer->conf[REMOTE],
&feerate_per_kw,
&peer->their_commit_sig, &peer->their_commit_sig,
&peer->pcs.cs, &peer->pcs.cs,
&funding_pubkey[REMOTE], &funding_pubkey[REMOTE],
@ -1689,7 +1691,7 @@ static void init_channel(struct peer *peer)
peer->channel = new_channel(peer, &funding_txid, funding_txout, peer->channel = new_channel(peer, &funding_txid, funding_txout,
funding_satoshi, funding_satoshi,
local_msatoshi, local_msatoshi,
peer->fee_base, feerate_per_kw,
&peer->conf[LOCAL], &peer->conf[REMOTE], &peer->conf[LOCAL], &peer->conf[REMOTE],
&points[LOCAL], &points[REMOTE], &points[LOCAL], &points[REMOTE],
&funding_pubkey[LOCAL], &funding_pubkey[LOCAL],

1
lightningd/channel/channel_wire.csv

@ -27,6 +27,7 @@ channel_init,,funding_txout,2
channel_init,,funding_satoshi,8 channel_init,,funding_satoshi,8
channel_init,,our_config,struct channel_config channel_init,,our_config,struct channel_config
channel_init,,their_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,,first_commit_sig,secp256k1_ecdsa_signature
channel_init,,crypto_state,struct crypto_state channel_init,,crypto_state,struct crypto_state
channel_init,,remote_fundingkey,33 channel_init,,remote_fundingkey,33

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

1
lightningd/peer_control.c

@ -1196,6 +1196,7 @@ static bool peer_start_channeld(struct peer *peer,
peer->funding_satoshi, peer->funding_satoshi,
&peer->our_config, &peer->our_config,
&peer->channel_info->their_config, &peer->channel_info->their_config,
peer->channel_info->feerate_per_kw,
&peer->channel_info->commit_sig, &peer->channel_info->commit_sig,
cs, cs,
&peer->channel_info->remote_fundingkey, &peer->channel_info->remote_fundingkey,

Loading…
Cancel
Save