File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -10584,7 +10584,24 @@ where
10584
10584
.or_else(|| {
10585
10585
self.is_our_channel_ready().then(|| self.funding.get_funding_txid()).flatten()
10586
10586
})
10587
- .map(|txid| msgs::FundingLocked { txid, retransmit_flags: 0 })
10587
+ .map(|txid| {
10588
+ let mut funding_locked = msgs::FundingLocked { txid, retransmit_flags: 0 };
10589
+
10590
+ // - if `my_current_funding_locked` is included:
10591
+ // - if `announce_channel` is set for this channel:
10592
+ // - if it has not received `announcement_signatures` for that transaction:
10593
+ // - MUST set the `announcement_signatures` bit to `1` in `retransmit_flags`.
10594
+ // - otherwise:
10595
+ // - MUST set the `announcement_signatures` bit to `0` in `retransmit_flags`.
10596
+ if self.funding.get_funding_txid() == Some(txid)
10597
+ && self.context.config.announce_for_forwarding
10598
+ && self.context.announcement_sigs.is_none()
10599
+ {
10600
+ funding_locked.retransmit(msgs::RetransmitFlag::AnnouncementSignatures);
10601
+ };
10602
+
10603
+ funding_locked
10604
+ })
10588
10605
}
10589
10606
10590
10607
#[cfg(not(splicing))]
Original file line number Diff line number Diff line change @@ -945,12 +945,24 @@ pub struct FundingLocked {
945
945
946
946
/// A bitfield indicating which messages should be retransmitted by the receiving node.
947
947
///
948
- /// | Bit Position | Name |
949
- /// | ------------- | --------------------------|
950
- /// | 0 | `announcement_signatures` |
948
+ /// See [`RetransmitFlag`] for details.
951
949
pub retransmit_flags : u8 ,
952
950
}
953
951
952
+ impl FundingLocked {
953
+ /// Sets the bit in `retransmit_flags` for retransmitting the message corresponding to `flag`.
954
+ pub fn retransmit ( & mut self , flag : RetransmitFlag ) {
955
+ self . retransmit_flags |= 1 << flag as u8 ;
956
+ }
957
+ }
958
+
959
+ /// Bit positions used in [`FundingLocked::retransmit_flags`] for requesting message retransmission.
960
+ #[ repr( u8 ) ]
961
+ pub enum RetransmitFlag {
962
+ /// Retransmit `announcement_signatures`.
963
+ AnnouncementSignatures = 0 ,
964
+ }
965
+
954
966
/// An [`announcement_signatures`] message to be sent to or received from a peer.
955
967
///
956
968
/// [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
You can’t perform that action at this time.
0 commit comments