Skip to content

Commit ac4e17e

Browse files
committed
Set funding_locked_txid TLVs in channel_reestablish
The previous commit extended the channel_reestablish message with your_last_funding_locked_txid and my_current_funding_locked_txid for use as described there. This commit sets those fields to the funding txid most recently sent/received accordingly.
1 parent 55ab7e5 commit ac4e17e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10506,6 +10506,22 @@ where
1050610506
}
1050710507
}
1050810508

10509+
#[cfg(splicing)]
10510+
fn maybe_get_my_current_funding_locked(&self) -> Option<msgs::FundingLocked> {
10511+
self.pending_splice
10512+
.as_ref()
10513+
.and_then(|pending_splice| pending_splice.sent_funding_txid)
10514+
.or_else(|| {
10515+
self.is_our_channel_ready().then(|| self.funding.get_funding_txid()).flatten()
10516+
})
10517+
.map(|txid| msgs::FundingLocked { txid, retransmit_flags: 0 })
10518+
}
10519+
10520+
#[cfg(not(splicing))]
10521+
fn maybe_get_my_current_funding_locked(&self) -> Option<msgs::FundingLocked> {
10522+
None
10523+
}
10524+
1050910525
/// May panic if called on a channel that wasn't immediately-previously
1051010526
/// self.remove_uncommitted_htlcs_and_mark_paused()'d
1051110527
#[rustfmt::skip]
@@ -10557,7 +10573,7 @@ where
1055710573
your_last_per_commitment_secret: remote_last_secret,
1055810574
my_current_per_commitment_point: dummy_pubkey,
1055910575
next_funding_txid: self.maybe_get_next_funding_txid(),
10560-
my_current_funding_locked: None,
10576+
my_current_funding_locked: self.maybe_get_my_current_funding_locked(),
1056110577
}
1056210578
}
1056310579

0 commit comments

Comments
 (0)