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

Function trim_route

plugins/libplugin-pay.c:2697–2702  ·  view source on GitHub ↗

Trim route to this length by taking from the *front* of route * (end points to destination, so we need that bit!) */

Source from the content-addressed store, hash-verified

2695/* Trim route to this length by taking from the *front* of route
2696 * (end points to destination, so we need that bit!) */
2697static void trim_route(struct route_info **route, size_t n)
2698{
2699 size_t remove = tal_count(*route) - n;
2700 memmove(*route, *route + remove, sizeof(**route) * n);
2701 tal_resize(route, n);
2702}
2703
2704/* Make sure routehints are reasonable length, and (since we assume we
2705 * can append), not directly to us. Note: untrusted data! */

Callers 1

filter_routehintsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected