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

Function channel_is_between

common/test/run-route.c:131–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static bool channel_is_between(const struct gossmap *gossmap,
132 const struct route_hop *route,
133 const struct gossmap_node *a,
134 const struct gossmap_node *b)
135{
136 const struct gossmap_chan *c = gossmap_find_chan(gossmap, &route->scid);
137 if (c->half[route->direction].nodeidx
138 != gossmap_node_idx(gossmap, a))
139 return false;
140 if (c->half[!route->direction].nodeidx
141 != gossmap_node_idx(gossmap, b))
142 return false;
143
144 return true;
145}
146
147/* route_can_carry disregards unless *both* dirs are enabled, so we use
148 * 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