Skip to content

Commit 896f5b8

Browse files
committed
Fix failure sending FundingLocked for non-announced channels
1 parent 88c301c commit 896f5b8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/ln/channel.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,10 @@ impl Channel {
18431843
self.channel_update_count
18441844
}
18451845

1846+
pub fn should_announce(&self) -> bool {
1847+
self.announce_publicly
1848+
}
1849+
18461850
/// Gets the fee we'd want to charge for adding an HTLC output to this Channel
18471851
pub fn get_our_fee_base_msat(&self, fee_estimator: &FeeEstimator) -> u32 {
18481852
// For lack of a better metric, we calculate what it would cost to consolidate the new HTLC

src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ impl ChannelManager {
710710
}
711711

712712
fn get_announcement_sigs(&self, chan: &Channel) -> Result<Option<msgs::AnnouncementSignatures>, HandleError> {
713-
if !chan.is_usable() { return Ok(None) }
713+
if !chan.is_usable() || !chan.should_announce() { return Ok(None) }
714714

715715
let (announcement, our_bitcoin_sig) = chan.get_channel_announcement(self.get_our_node_id(), self.genesis_hash.clone())?;
716716
let msghash = Message::from_slice(&Sha256dHash::from_data(&announcement.encode()[..])[..]).unwrap();

0 commit comments

Comments
 (0)