From: Matt Corallo Date: Sun, 22 Jul 2018 20:39:34 +0000 (-0400) Subject: Fix failure sending FundingLocked for non-announced channels X-Git-Tag: v0.0.12~381^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=896f5b8d914a1cc7211ec612201fdceb6abc7d12;p=rust-lightning Fix failure sending FundingLocked for non-announced channels --- 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();