@@ -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 ;
@@ -541,6 +544,7 @@ static bool funder_finalize_channel_setup(struct state *state,
541544 state -> funding_txout ,
542545 state -> localconf .to_self_delay ,
543546 state -> upfront_shutdown_script [LOCAL ],
547+ state -> local_upfront_shutdown_wallet_index ,
544548 & state -> their_points ,
545549 & state -> their_funding_pubkey ,
546550 state -> remoteconf .to_self_delay ,
@@ -991,7 +995,8 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
991995 /* We don't allocate off tmpctx, because that's freed inside
992996 * opening_negotiate_msg */
993997 if (!fromwire_openingd_got_offer_reply (state , msg , & err_reason ,
994- & state -> upfront_shutdown_script [LOCAL ]))
998+ & state -> upfront_shutdown_script [LOCAL ],
999+ & state -> local_upfront_shutdown_wallet_index ))
9951000 master_badmsg (WIRE_OPENINGD_GOT_OFFER_REPLY , msg );
9961001
9971002 /* If they give us a reason to reject, do so. */
@@ -1071,6 +1076,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
10711076 state -> funding_txout ,
10721077 state -> localconf .to_self_delay ,
10731078 state -> upfront_shutdown_script [LOCAL ],
1079+ state -> local_upfront_shutdown_wallet_index ,
10741080 & theirs ,
10751081 & their_funding_pubkey ,
10761082 state -> remoteconf .to_self_delay ,
@@ -1353,6 +1359,7 @@ static u8 *handle_master_in(struct state *state)
13531359 if (!fromwire_openingd_funder_start (state , msg , & state -> funding ,
13541360 & state -> push_msat ,
13551361 & state -> upfront_shutdown_script [LOCAL ],
1362+ & state -> local_upfront_shutdown_wallet_index ,
13561363 & state -> feerate_per_kw ,
13571364 & channel_flags ))
13581365 master_badmsg (WIRE_OPENINGD_FUNDER_START , msg );
0 commit comments