@@ -5401,6 +5401,35 @@ static void peer_reconnect(struct peer *peer,
54015401#endif
54025402
54035403 inflight = last_inflight (peer );
5404+
5405+ if (feature_negotiated (peer -> our_features , peer -> their_features , OPT_SPLICE )) {
5406+ /* Subtle: we free tmpctx below as we loop, so tal off peer */
5407+ send_tlvs = tlv_channel_reestablish_tlvs_new (peer );
5408+
5409+ /* BOLT- #2: channel_reestablish
5410+ * your_last_funding_locked tlv:
5411+ * - as a sender, you just set it to the last splice_locked you received from your peer
5412+ * - as a receiver, this tells you if your peer received your last splice_locked or not
5413+ */
5414+ if (peer -> splice_state -> locked_ready [REMOTE ] && peer -> splice_state -> remote_locked_txid != NULL ) {
5415+ send_tlvs -> your_last_funding_locked_txid = tal_dup (send_tlvs , struct bitcoin_txid , peer -> splice_state -> remote_locked_txid );
5416+ }
5417+ else {
5418+ send_tlvs -> your_last_funding_locked_txid = tal_dup (send_tlvs , struct bitcoin_txid , & peer -> channel -> funding .txid );
5419+ }
5420+
5421+ /*
5422+ * my_current_funding_locked tlv:
5423+ * - as a sender, you just send it to your latest locally locked (ie deeply confirmed) splice transaction
5424+ * - as a receiver, this tells you whether your peer will be sending a splice_locked that you haven't received yet
5425+ */
5426+ if (peer -> splice_state -> locked_ready [LOCAL ]) {
5427+ send_tlvs -> my_current_funding_locked_txid = tal_dup (send_tlvs , struct bitcoin_txid , & peer -> splice_state -> locked_txid );
5428+ }
5429+ else {
5430+ send_tlvs -> my_current_funding_locked_txid = tal_dup (send_tlvs , struct bitcoin_txid , & peer -> channel -> funding .txid );
5431+ }
5432+ }
54045433
54055434 send_next_commitment_number = peer -> next_index [LOCAL ];
54065435 if (inflight && (!inflight -> last_tx || !inflight -> remote_tx_sigs )) {
0 commit comments