From: Matt Corallo Date: Sat, 27 Oct 2018 05:45:15 +0000 (-0400) Subject: fix broken state comparison (thanks @yuntai!) X-Git-Tag: v0.0.12~282^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=4a51f4f073a7864b75d48c05397f23f8a2792e12;p=rust-lightning fix broken state comparison (thanks @yuntai!) --- 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();