From: Jeffrey Czyz Date: Fri, 10 Apr 2020 18:36:47 +0000 (-0700) Subject: Unset upfront_shutdown_script using bit clearing X-Git-Tag: v0.0.12~69^2~8 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=c1db30d5be88e312e10efb47e26aade95413a01b;p=rust-lightning Unset upfront_shutdown_script using bit clearing The test_upfront_shutdown_script functional test clears this feature flag. However, the method used to clear the flag is implemented by bit toggling. Thus, if the flag is not set the method would actually set it. Implement the method using bit clearing instead. --- diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index 5eb1bd909..1e52268ac 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -272,7 +272,7 @@ impl Features { } #[cfg(test)] pub(crate) fn unset_upfront_shutdown_script(&mut self) { - self.flags[0] ^= 1 << 5; + self.flags[0] &= !(1 << 5); } }