- /// Allowed in any state (including after shutdown)
- pub fn get_update_time_counter(&self) -> u32 {
- self.context.update_time_counter
- }
-
- pub fn get_latest_monitor_update_id(&self) -> u64 {
- self.context.latest_monitor_update_id
- }
-
- pub fn should_announce(&self) -> bool {
- self.context.config.announced_channel
- }
-
- pub fn is_outbound(&self) -> bool {
- self.context.channel_transaction_parameters.is_outbound_from_holder
- }
-
- /// Gets the fee we'd want to charge for adding an HTLC output to this Channel
- /// Allowed in any state (including after shutdown)
- pub fn get_outbound_forwarding_fee_base_msat(&self) -> u32 {
- self.context.config.options.forwarding_fee_base_msat
- }
-
- /// Returns true if we've ever received a message from the remote end for this Channel
- pub fn have_received_message(&self) -> bool {
- self.context.channel_state > (ChannelState::OurInitSent as u32)
- }
-
- /// Returns true if this channel is fully established and not known to be closing.
- /// Allowed in any state (including after shutdown)
- pub fn is_usable(&self) -> bool {
- let mask = ChannelState::ChannelReady as u32 | BOTH_SIDES_SHUTDOWN_MASK;
- (self.context.channel_state & mask) == (ChannelState::ChannelReady as u32) && !self.context.monitor_pending_channel_ready
- }
-
- /// Returns true if this channel is currently available for use. This is a superset of
- /// is_usable() and considers things like the channel being temporarily disabled.
- /// Allowed in any state (including after shutdown)
- pub fn is_live(&self) -> bool {
- self.is_usable() && (self.context.channel_state & (ChannelState::PeerDisconnected as u32) == 0)
- }
-