Skip to content

Commit

Permalink
Mask off invalid flag bits when using Not
Browse files Browse the repository at this point in the history
  • Loading branch information
wpaulino committed Dec 8, 2023
1 parent a281992 commit 8adab45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,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;
Expand Down

0 comments on commit 8adab45

Please sign in to comment.