dual-funding: rework how funding feerates are passed around

Cleans up some duplication/unnecessary re-assignment of the feerate.
Left over from when the feerates used to be min/max/best in
open_channel2.
This commit is contained in:
niftynei 2021-04-09 14:55:45 -05:00 committed by Rusty Russell
parent 0ae2b0c33d
commit b366453c6a
1 changed files with 3 additions and 7 deletions

View File

@ -1908,7 +1908,7 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
if (!fromwire_open_channel2(oc2_msg, &chain_hash,
&state->channel_id, /* Temporary! */
&state->feerate_per_kw_funding,
&tx_state->feerate_per_kw_funding,
&state->feerate_per_kw_commitment,
&tx_state->opener_funding,
&tx_state->remoteconf.dust_limit,
@ -1955,8 +1955,8 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
&state->their_points.revocation);
/* Save feerate on the tx_state as well */
tx_state->feerate_per_kw_funding = state->feerate_per_kw_funding;
/* Save feerate on the state as well */
state->feerate_per_kw_funding = tx_state->feerate_per_kw_funding;
/* BOLT #2:
*
@ -2021,10 +2021,6 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
&state->upfront_shutdown_script[LOCAL]))
master_badmsg(WIRE_DUALOPEND_GOT_OFFER_REPLY, msg);
/* Set the state's feerate per kw funding, also. This is
* the original feerate we'll base any increases off of. */
state->feerate_per_kw_funding = tx_state->feerate_per_kw_funding;
if (!tx_state->psbt)
tx_state->psbt = create_psbt(tx_state, 0, 0,
tx_state->tx_locktime);