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

Function channel_is_between

common/test/run-route.c:143–157  ·  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 if (c->half[route->direction].nodeidx
150 != gossmap_node_idx(gossmap, a))
151 return false;
152 if (c->half[!route->direction].nodeidx
153 != gossmap_node_idx(gossmap, b))
154 return false;
155
156 return true;
157}
158
159/* route_can_carry disregards unless *both* dirs are enabled, so we use
160 * 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