True if feature bit b (or its odd/compulsory twin) is set.
(bits, b)
| 5213 | |
| 5214 | |
| 5215 | def feature_offered(bits, b): |
| 5216 | """True if feature bit b (or its odd/compulsory twin) is set.""" |
| 5217 | for x in (b, b ^ 1): |
| 5218 | idx = len(bits) - 1 - x // 8 |
| 5219 | if 0 <= idx < len(bits) and bits[idx] & (1 << (x % 8)): |
| 5220 | return True |
| 5221 | return False |
| 5222 | |
| 5223 | |
| 5224 | def raw_peer_connect(node): |
no outgoing calls
no test coverage detected