Ensure channel is live, not usable for sending fee updates
[rust-lightning] / src / ln / channel.rs
index 5c861b2eae7b4dec8293815fdab53f28535c79eb..1b7db97d3d342d1a97551b3a274c37425a07d8a2 100644 (file)
@@ -1960,10 +1960,12 @@ impl Channel {
                if !self.channel_outbound {
                        panic!("Cannot send fee from inbound channel");
                }
-
                if !self.is_usable() {
                        panic!("Cannot update fee until channel is fully established and we haven't started shutting down");
                }
+               if !self.is_live() {
+                       panic!("Cannot update fee while peer is disconnected (ChannelManager should have caught this)");
+               }
 
                if (self.channel_state & (ChannelState::AwaitingRemoteRevoke as u32)) == (ChannelState::AwaitingRemoteRevoke as u32) {
                        self.holding_cell_update_fee = Some(feerate_per_kw);