Skip to content

Commit

Permalink
dual-funding: rework how funding feerates are passed around
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
niftynei authored and rustyrussell committed Apr 16, 2021
1 parent 0ae2b0c commit b366453
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions openingd/dualopend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b366453

Please sign in to comment.