MCPcopy Create free account
hub / github.com/ElementsProject/lightning / feature_offered

Function feature_offered

tests/test_connection.py:5215–5221  ·  view source on GitHub ↗

True if feature bit b (or its odd/compulsory twin) is set.

(bits, b)

Source from the content-addressed store, hash-verified

5213
5214
5215def 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
5224def raw_peer_connect(node):

Callers 2

raw_peer_connectFunction · 0.70
handle_initFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected