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

Function channel_is_between

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

Source from the content-addressed store, hash-verified

155}
156
157static bool channel_is_between(const struct gossmap *gossmap,
158 const struct route_hop *route,
159 const struct gossmap_node *a,
160 const struct gossmap_node *b)
161{
162 const struct gossmap_chan *c = gossmap_find_chan(gossmap, &route->scid);
163
164 if (c->half[route->direction].nodeidx
165 != gossmap_node_idx(gossmap, a))
166 return false;
167 if (c->half[!route->direction].nodeidx
168 != gossmap_node_idx(gossmap, b))
169 return false;
170
171 return true;
172}
173
174/* route_can_carry disregards unless *both* dirs are enabled, so we use
175 * 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