From 4a51f4f073a7864b75d48c05397f23f8a2792e12 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 27 Oct 2018 01:45:15 -0400 Subject: [PATCH] fix broken state comparison (thanks @yuntai!) --- src/ln/channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ln/channel.rs b/src/ln/channel.rs index f2b5b3a88..5c04414a2 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -3084,7 +3084,7 @@ impl Channel { if (self.channel_state & (ChannelState::PeerDisconnected as u32)) == (ChannelState::PeerDisconnected as u32) { panic!("Cannot create commitment tx while disconnected, as send_htlc will have returned an Err so a send_commitment precondition has been violated"); } - if (self.channel_state & (ChannelState::MonitorUpdateFailed as u32)) == (ChannelState::PeerDisconnected as u32) { + if (self.channel_state & (ChannelState::MonitorUpdateFailed as u32)) == (ChannelState::MonitorUpdateFailed as u32) { panic!("Cannot create commitment tx while awaiting monitor update unfreeze, as send_htlc will have returned an Err so a send_commitment precondition has been violated"); } let mut have_updates = self.pending_update_fee.is_some(); -- 2.39.5