@@ -3450,6 +3450,39 @@ static struct inflight *inflights_new(struct peer *peer)
3450
3450
return inf ;
3451
3451
}
3452
3452
3453
+ static void update_hsmd_with_splice (struct peer * peer , struct inflight * inflight )
3454
+ {
3455
+ u8 * msg ;
3456
+
3457
+ // These aren't allowed to change, so we don't need to gather them
3458
+ u8 * local_upfront_shutdown_script = NULL ;
3459
+ u32 * local_upfront_shutdown_wallet_index = NULL ;
3460
+ u8 * remote_upfront_shutdown_script = NULL ;
3461
+
3462
+ // FIXME - the push_value needs to reflect what is owed to the non-opener
3463
+ struct amount_msat push_value = AMOUNT_MSAT (0 );
3464
+
3465
+ msg = towire_hsmd_setup_channel (
3466
+ NULL ,
3467
+ peer -> channel -> opener == LOCAL ,
3468
+ inflight -> amnt ,
3469
+ push_value ,
3470
+ & inflight -> outpoint .txid ,
3471
+ inflight -> outpoint .n ,
3472
+ peer -> channel -> config [LOCAL ].to_self_delay ,
3473
+ local_upfront_shutdown_script ,
3474
+ local_upfront_shutdown_wallet_index ,
3475
+ & peer -> channel -> basepoints [REMOTE ],
3476
+ & peer -> channel -> funding_pubkey [REMOTE ],
3477
+ peer -> channel -> config [REMOTE ].to_self_delay ,
3478
+ remote_upfront_shutdown_script ,
3479
+ peer -> channel -> type );
3480
+ msg = (u8 * ) hsm_req (tmpctx , take (msg ));
3481
+ if (!fromwire_hsmd_setup_channel_reply (msg ))
3482
+ status_failed (STATUS_FAIL_HSM_IO , "Bad setup_channel_reply %s" ,
3483
+ tal_hex (tmpctx , msg ));
3484
+ }
3485
+
3453
3486
/* ACCEPTER side of the splice. Here we handle all the accepter's steps for the
3454
3487
* splice. Since the channel must be in STFU mode we block the daemon here until
3455
3488
* the splice is finished or aborted. */
@@ -3586,6 +3619,8 @@ static void splice_accepter(struct peer *peer, const u8 *inmsg)
3586
3619
new_inflight -> last_tx = NULL ;
3587
3620
new_inflight -> i_am_initiator = false;
3588
3621
3622
+ update_hsmd_with_splice (peer , new_inflight );
3623
+
3589
3624
update_view_from_inflights (peer );
3590
3625
3591
3626
peer -> splice_state -> count ++ ;
@@ -3820,6 +3855,8 @@ static void splice_initiator_user_finalized(struct peer *peer)
3820
3855
new_inflight -> last_tx = NULL ;
3821
3856
new_inflight -> i_am_initiator = true;
3822
3857
3858
+ update_hsmd_with_splice (peer , new_inflight );
3859
+
3823
3860
update_view_from_inflights (peer );
3824
3861
3825
3862
peer -> splice_state -> count ++ ;
0 commit comments