From 896f5b8d914a1cc7211ec612201fdceb6abc7d12 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 22 Jul 2018 16:39:34 -0400 Subject: [PATCH] Fix failure sending FundingLocked for non-announced channels --- src/ln/channel.rs | 4 ++++ src/ln/channelmanager.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ln/channel.rs b/src/ln/channel.rs index 4565b2437..d4d264b0a 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -1843,6 +1843,10 @@ impl Channel { self.channel_update_count } + pub fn should_announce(&self) -> bool { + self.announce_publicly + } + /// Gets the fee we'd want to charge for adding an HTLC output to this Channel pub fn get_our_fee_base_msat(&self, fee_estimator: &FeeEstimator) -> u32 { // For lack of a better metric, we calculate what it would cost to consolidate the new HTLC diff --git a/src/ln/channelmanager.rs b/src/ln/channelmanager.rs index b17dcd819..f4f9ef881 100644 --- a/src/ln/channelmanager.rs +++ b/src/ln/channelmanager.rs @@ -710,7 +710,7 @@ impl ChannelManager { } fn get_announcement_sigs(&self, chan: &Channel) -> Result, HandleError> { - if !chan.is_usable() { return Ok(None) } + if !chan.is_usable() || !chan.should_announce() { return Ok(None) } let (announcement, our_bitcoin_sig) = chan.get_channel_announcement(self.get_our_node_id(), self.genesis_hash.clone())?; let msghash = Message::from_slice(&Sha256dHash::from_data(&announcement.encode()[..])[..]).unwrap(); -- 2.39.5