Skip to content

Commit 7a234b6

Browse files
committed
Fill out IgnoreError actions in get_channel_announcement
They are all just "its too early/late to get an announcement" errors so simply ignoring them and not sending an announce is fine
1 parent 2202d13 commit 7a234b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ln/channel.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,13 +2298,13 @@ impl Channel {
22982298
/// https://github.com/lightningnetwork/lightning-rfc/issues/468
22992299
pub fn get_channel_announcement(&self, our_node_id: PublicKey, chain_hash: Sha256dHash) -> Result<(msgs::UnsignedChannelAnnouncement, Signature), HandleError> {
23002300
if !self.announce_publicly {
2301-
return Err(HandleError{err: "Channel is not available for public announcements", action: None});
2301+
return Err(HandleError{err: "Channel is not available for public announcements", action: Some(msgs::ErrorAction::IgnoreError)});
23022302
}
23032303
if self.channel_state & (ChannelState::ChannelFunded as u32) == 0 {
2304-
return Err(HandleError{err: "Cannot get a ChannelAnnouncement until the channel funding has been locked", action: None});
2304+
return Err(HandleError{err: "Cannot get a ChannelAnnouncement until the channel funding has been locked", action: Some(msgs::ErrorAction::IgnoreError)});
23052305
}
23062306
if (self.channel_state & (ChannelState::LocalShutdownSent as u32 | ChannelState::ShutdownComplete as u32)) != 0 {
2307-
return Err(HandleError{err: "Cannot get a ChannelAnnouncement once the channel is closing", action: None});
2307+
return Err(HandleError{err: "Cannot get a ChannelAnnouncement once the channel is closing", action: Some(msgs::ErrorAction::IgnoreError)});
23082308
}
23092309

23102310
let were_node_one = our_node_id.serialize()[..] < self.their_node_id.serialize()[..];

0 commit comments

Comments
 (0)