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

Function adjacent_before

devtools/bolt-coverage.py:148–154  ·  view source on GitHub ↗

All records whose covered range ends closest to (but not after) gap_start.

(records: List[CovRecord], gap_start: int)

Source from the content-addressed store, hash-verified

146
147
148def adjacent_before(records: List[CovRecord], gap_start: int) -> List[CovRecord]:
149 """All records whose covered range ends closest to (but not after) gap_start."""
150 candidates = [r for r in records if r[2] <= gap_start]
151 if not candidates:
152 return []
153 max_end = max(r[2] for r in candidates)
154 return [r for r in candidates if r[2] == max_end]
155
156
157def adjacent_after(records: List[CovRecord], gap_end: int) -> List[CovRecord]:

Callers 1

show_gapsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected