From c1db30d5be88e312e10efb47e26aade95413a01b Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Fri, 10 Apr 2020 11:36:47 -0700 Subject: [PATCH] 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. --- lightning/src/ln/features.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index 5eb1bd90..1e52268a 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); } } -- 2.30.2