From b366453c6a75e0dc210a5ffbb244ceb2c1a2b1b1 Mon Sep 17 00:00:00 2001 From: niftynei Date: Fri, 9 Apr 2021 14:55:45 -0500 Subject: [PATCH] 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. --- openingd/dualopend.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 0d85f2e5a..ad8d5420e 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -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);