@@ -36,6 +36,8 @@ static struct bitcoin_tx *close_tx(const tal_t *ctx,
3636 const struct chainparams * chainparams ,
3737 struct per_peer_state * pps ,
3838 const struct channel_id * channel_id ,
39+ u32 local_wallet_index ,
40+ const struct ext_key * local_wallet_ext_key ,
3941 u8 * scriptpubkey [NUM_SIDES ],
4042 const struct bitcoin_txid * funding_txid ,
4143 unsigned int funding_txout ,
@@ -69,6 +71,7 @@ static struct bitcoin_tx *close_tx(const tal_t *ctx,
6971 /* FIXME: We need to allow this! */
7072 tx = create_close_tx (ctx ,
7173 chainparams ,
74+ local_wallet_index , local_wallet_ext_key ,
7275 scriptpubkey [LOCAL ], scriptpubkey [REMOTE ],
7376 funding_wscript ,
7477 funding_txid ,
@@ -135,6 +138,8 @@ static void send_offer(struct per_peer_state *pps,
135138 const struct channel_id * channel_id ,
136139 const struct pubkey funding_pubkey [NUM_SIDES ],
137140 const u8 * funding_wscript ,
141+ u32 local_wallet_index ,
142+ const struct ext_key * local_wallet_ext_key ,
138143 u8 * scriptpubkey [NUM_SIDES ],
139144 const struct bitcoin_txid * funding_txid ,
140145 unsigned int funding_txout ,
@@ -156,6 +161,8 @@ static void send_offer(struct per_peer_state *pps,
156161 * #3](03-transactions.md#closing-transaction).
157162 */
158163 tx = close_tx (tmpctx , chainparams , pps , channel_id ,
164+ local_wallet_index ,
165+ local_wallet_ext_key ,
159166 scriptpubkey ,
160167 funding_txid ,
161168 funding_txout ,
@@ -215,6 +222,8 @@ receive_offer(struct per_peer_state *pps,
215222 const struct channel_id * channel_id ,
216223 const struct pubkey funding_pubkey [NUM_SIDES ],
217224 const u8 * funding_wscript ,
225+ u32 local_wallet_index ,
226+ const struct ext_key * local_wallet_ext_key ,
218227 u8 * scriptpubkey [NUM_SIDES ],
219228 const struct bitcoin_txid * funding_txid ,
220229 unsigned int funding_txout ,
@@ -269,6 +278,8 @@ receive_offer(struct per_peer_state *pps,
269278 * - MUST fail the connection.
270279 */
271280 tx = close_tx (tmpctx , chainparams , pps , channel_id ,
281+ local_wallet_index ,
282+ local_wallet_ext_key ,
272283 scriptpubkey ,
273284 funding_txid ,
274285 funding_txout ,
@@ -300,6 +311,8 @@ receive_offer(struct per_peer_state *pps,
300311 * - MAY eliminate its own output.
301312 */
302313 trimmed = close_tx (tmpctx , chainparams , pps , channel_id ,
314+ local_wallet_index ,
315+ local_wallet_ext_key ,
303316 scriptpubkey ,
304317 funding_txid ,
305318 funding_txout ,
@@ -506,6 +519,8 @@ int main(int argc, char *argv[])
506519 struct amount_sat min_fee_to_accept , commitment_fee , offer [NUM_SIDES ];
507520 struct feerange feerange ;
508521 enum side opener ;
522+ u32 local_wallet_index ;
523+ struct ext_key local_wallet_ext_key ;
509524 u8 * scriptpubkey [NUM_SIDES ], * funding_wscript ;
510525 u64 fee_negotiation_step ;
511526 u8 fee_negotiation_step_unit ;
@@ -533,6 +548,8 @@ int main(int argc, char *argv[])
533548 & our_dust_limit ,
534549 & min_fee_to_accept , & commitment_fee ,
535550 & offer [LOCAL ],
551+ & local_wallet_index ,
552+ & local_wallet_ext_key ,
536553 & scriptpubkey [LOCAL ],
537554 & scriptpubkey [REMOTE ],
538555 & fee_negotiation_step ,
@@ -590,6 +607,8 @@ int main(int argc, char *argv[])
590607 if (whose_turn == LOCAL ) {
591608 send_offer (pps , chainparams ,
592609 & channel_id , funding_pubkey , funding_wscript ,
610+ local_wallet_index ,
611+ & local_wallet_ext_key ,
593612 scriptpubkey , & funding_txid , funding_txout ,
594613 funding , out , opener ,
595614 our_dust_limit ,
@@ -610,6 +629,8 @@ int main(int argc, char *argv[])
610629 = receive_offer (pps , chainparams ,
611630 & channel_id , funding_pubkey ,
612631 funding_wscript ,
632+ local_wallet_index ,
633+ & local_wallet_ext_key ,
613634 scriptpubkey , & funding_txid ,
614635 funding_txout , funding ,
615636 out , opener ,
@@ -641,6 +662,8 @@ int main(int argc, char *argv[])
641662 fee_negotiation_step_unit );
642663 send_offer (pps , chainparams , & channel_id ,
643664 funding_pubkey , funding_wscript ,
665+ local_wallet_index ,
666+ & local_wallet_ext_key ,
644667 scriptpubkey , & funding_txid , funding_txout ,
645668 funding , out , opener ,
646669 our_dust_limit ,
@@ -656,6 +679,8 @@ int main(int argc, char *argv[])
656679 = receive_offer (pps , chainparams , & channel_id ,
657680 funding_pubkey ,
658681 funding_wscript ,
682+ local_wallet_index ,
683+ & local_wallet_ext_key ,
659684 scriptpubkey , & funding_txid ,
660685 funding_txout , funding ,
661686 out , opener ,
0 commit comments