Skip to content

Commit 4543309

Browse files
committed
Merge rust-bitcoin#2845: fix ServiceFlags::remove
0949be9 fix ServiceFlags::remove (Antoni Spaanderman) Pull request description: Contrary to the documentation and the method name, this function does an XOR operation, if there are no flags in `self`, flags from `other` are added. What should happen to the core::ops::BitXor{,Assign} implementations? I did not touch them because it would break current API usage and would require a minor version bump (on 0.x.y versions). ACKs for top commit: Kixunil: ACK 0949be9 apoelstra: ACK 0949be9 looks good. I think it is fine to retain a BitXor impl on a flag type, even if it is questionably useful Tree-SHA512: d73853e5fe5e3776ef5cfb54c1ae2f9151c17c51861759b096eae339d4c9a544a9a32f5cc23e76f79827a40425a8a0823e2b989ed9ab98b8373d2b8d94418e8e
2 parents 0d72db7 + 0949be9 commit 4543309

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bitcoin/src/p2p/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl ServiceFlags {
110110
///
111111
/// Returns itself.
112112
pub fn remove(&mut self, other: ServiceFlags) -> ServiceFlags {
113-
self.0 ^= other.0;
113+
self.0 &= !other.0;
114114
*self
115115
}
116116

0 commit comments

Comments
 (0)