From ec4681a8f81b14ca1de719c2f4d5bc3c42e58e21 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Fri, 8 Dec 2023 13:18:27 -0800 Subject: [PATCH] Mask off invalid flag bits when using Not --- lightning/src/ln/channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index df047c0b18e..dcb05a61ce3 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -310,7 +310,7 @@ macro_rules! define_state_flags { impl core::ops::Not for $flag_type { type Output = Self; - fn not(self) -> Self::Output { Self(!self.0) } + fn not(self) -> Self::Output { Self(!self.0 & Self::ALL.0) } } impl core::ops::BitOr for $flag_type { type Output = Self;