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

Function channel_is_between

common/test/run-route-specific.c:143–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143static bool channel_is_between(const struct gossmap *gossmap,
144 const struct route_hop *route,
145 const struct gossmap_node *a,
146 const struct gossmap_node *b)
147{
148 const struct gossmap_chan *c = gossmap_find_chan(gossmap, &route->scid);
149
150 if (c->half[route->direction].nodeidx
151 != gossmap_node_idx(gossmap, a))
152 return false;
153 if (c->half[!route->direction].nodeidx
154 != gossmap_node_idx(gossmap, b))
155 return false;
156
157 return true;
158}
159
160/* route_can_carry disregards unless *both* dirs are enabled, so we use
161 * a simpler variant here */

Callers 1

mainFunction · 0.70

Calls 2

gossmap_find_chanFunction · 0.85
gossmap_node_idxFunction · 0.85

Tested by

no test coverage detected