self.user_id
}
+ /// May only be called after funding has been initiated (ie is_funding_initiated() is true)
pub fn channel_monitor(&self) -> ChannelMonitor {
if self.channel_state < ChannelState::FundingCreated as u32 {
panic!("Can't get a channel monitor until funding has been created");
self.is_usable()
}
+ /// Returns true if funding_created was sent/received.
+ pub fn is_funding_initiated(&self) -> bool {
+ self.channel_state >= ChannelState::FundingCreated as u32
+ }
+
/// Returns true if this channel is fully shut down. True here implies that no further actions
/// may/will be taken on this channel, and thus this object should be freed. Any future changes
/// will be handled appropriately by the chain monitor.
}
}
}
- if channel.channel_monitor().would_broadcast_at_height(height) {
+ if channel.is_funding_initiated() && channel.channel_monitor().would_broadcast_at_height(height) {
if let Some(short_id) = channel.get_short_channel_id() {
short_to_id.remove(&short_id);
}