Trim route to this length by taking from the *front* of route * (end points to destination, so we need that bit!) */
| 2695 | /* Trim route to this length by taking from the *front* of route |
| 2696 | * (end points to destination, so we need that bit!) */ |
| 2697 | static 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! */ |