Fill out IgnoreError actions in get_channel_announcement
authorMatt Corallo <git@bluematt.me>
Wed, 5 Sep 2018 00:02:33 +0000 (20:02 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 5 Sep 2018 00:27:58 +0000 (20:27 -0400)
They are all just "its too early/late to get an announcement"
errors so simply ignoring them and not sending an announce is fine

src/ln/channel.rs

index e9ba79f0b4d4e39fd3f3e10799ae1b9eda5c4a9f..14ab80c90ebfb7f4241a4497e02de5885a494b47 100644 (file)
@@ -2298,13 +2298,13 @@ impl Channel {
        /// https://github.com/lightningnetwork/lightning-rfc/issues/468
        pub fn get_channel_announcement(&self, our_node_id: PublicKey, chain_hash: Sha256dHash) -> Result<(msgs::UnsignedChannelAnnouncement, Signature), HandleError> {
                if !self.announce_publicly {
-                       return Err(HandleError{err: "Channel is not available for public announcements", action: None});
+                       return Err(HandleError{err: "Channel is not available for public announcements", action: Some(msgs::ErrorAction::IgnoreError)});
                }
                if self.channel_state & (ChannelState::ChannelFunded as u32) == 0 {
-                       return Err(HandleError{err: "Cannot get a ChannelAnnouncement until the channel funding has been locked", action: None});
+                       return Err(HandleError{err: "Cannot get a ChannelAnnouncement until the channel funding has been locked", action: Some(msgs::ErrorAction::IgnoreError)});
                }
                if (self.channel_state & (ChannelState::LocalShutdownSent as u32 | ChannelState::ShutdownComplete as u32)) != 0 {
-                       return Err(HandleError{err: "Cannot get a ChannelAnnouncement once the channel is closing", action: None});
+                       return Err(HandleError{err: "Cannot get a ChannelAnnouncement once the channel is closing", action: Some(msgs::ErrorAction::IgnoreError)});
                }
 
                let were_node_one = our_node_id.serialize()[..] < self.their_node_id.serialize()[..];