@@ -105,6 +105,9 @@ struct state {
105105 /* If non-NULL, this is the scriptpubkey we/they *must* close with */
106106 u8 * upfront_shutdown_script [NUM_SIDES ];
107107
108+ /* If not UINT32_MAX, the wallet index for the LOCAL script */
109+ u32 local_upfront_shutdown_wallet_index ;
110+
108111 /* This is a cluster of fields in open_channel and accept_channel which
109112 * indicate the restrictions each side places on the channel. */
110113 struct channel_config localconf , remoteconf ;
@@ -531,6 +534,7 @@ static bool funder_finalize_channel_setup(struct state *state,
531534 state -> funding_txout ,
532535 state -> localconf .to_self_delay ,
533536 state -> upfront_shutdown_script [LOCAL ],
537+ state -> local_upfront_shutdown_wallet_index ,
534538 & state -> their_points ,
535539 & state -> their_funding_pubkey ,
536540 state -> remoteconf .to_self_delay ,
@@ -980,7 +984,8 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
980984 /* We don't allocate off tmpctx, because that's freed inside
981985 * opening_negotiate_msg */
982986 if (!fromwire_openingd_got_offer_reply (state , msg , & err_reason ,
983- & state -> upfront_shutdown_script [LOCAL ]))
987+ & state -> upfront_shutdown_script [LOCAL ],
988+ & state -> local_upfront_shutdown_wallet_index ))
984989 master_badmsg (WIRE_OPENINGD_GOT_OFFER_REPLY , msg );
985990
986991 /* If they give us a reason to reject, do so. */
@@ -1060,6 +1065,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
10601065 state -> funding_txout ,
10611066 state -> localconf .to_self_delay ,
10621067 state -> upfront_shutdown_script [LOCAL ],
1068+ state -> local_upfront_shutdown_wallet_index ,
10631069 & theirs ,
10641070 & their_funding_pubkey ,
10651071 state -> remoteconf .to_self_delay ,
@@ -1343,6 +1349,7 @@ static u8 *handle_master_in(struct state *state)
13431349 if (!fromwire_openingd_funder_start (state , msg , & state -> funding ,
13441350 & state -> push_msat ,
13451351 & state -> upfront_shutdown_script [LOCAL ],
1352+ & state -> local_upfront_shutdown_wallet_index ,
13461353 & state -> feerate_per_kw ,
13471354 & channel_flags ))
13481355 master_badmsg (WIRE_OPENINGD_FUNDER_START , msg );
0 commit comments