|
23 | 23 | #include <math.h> |
24 | 24 | #include <plugins/askrene/askrene.h> |
25 | 25 | #include <plugins/askrene/child/additional_costs.h> |
26 | | -#include <plugins/askrene/child/child_log.h> |
27 | 26 | #include <plugins/askrene/child/entry.h> |
| 27 | +#include <plugins/askrene/child/route_query.h> |
28 | 28 | #include <plugins/askrene/layer.h> |
29 | 29 | #include <plugins/askrene/reserve.h> |
30 | 30 | #include <sys/wait.h> |
@@ -266,17 +266,6 @@ static struct layer *remove_small_channel_layer(const tal_t *ctx, |
266 | 266 | return layer; |
267 | 267 | } |
268 | 268 |
|
269 | | -struct amount_msat get_additional_per_htlc_cost(const struct route_query *rq, |
270 | | - const struct short_channel_id_dir *scidd) |
271 | | -{ |
272 | | - const struct per_htlc_cost *phc; |
273 | | - phc = additional_cost_htable_get(rq->additional_costs, scidd); |
274 | | - if (phc) |
275 | | - return phc->per_htlc_cost; |
276 | | - else |
277 | | - return AMOUNT_MSAT(0); |
278 | | -} |
279 | | - |
280 | 269 | PRINTF_FMT(4, 5) |
281 | 270 | static const char *cmd_log(const tal_t *ctx, |
282 | 271 | struct command *cmd, |
@@ -379,42 +368,6 @@ static void apply_layers(struct askrene *askrene, |
379 | 368 | } |
380 | 369 | } |
381 | 370 |
|
382 | | -void get_constraints(const struct route_query *rq, |
383 | | - const struct gossmap_chan *chan, |
384 | | - int dir, |
385 | | - struct amount_msat *min, |
386 | | - struct amount_msat *max) |
387 | | -{ |
388 | | - struct short_channel_id_dir scidd; |
389 | | - size_t idx = gossmap_chan_idx(rq->gossmap, chan); |
390 | | - |
391 | | - *min = AMOUNT_MSAT(0); |
392 | | - |
393 | | - /* Fast path: no information known, no reserve. */ |
394 | | - if (idx < tal_count(rq->capacities) && rq->capacities[idx] != 0) { |
395 | | - *max = amount_msat(fp16_to_u64(rq->capacities[idx]) * 1000); |
396 | | - return; |
397 | | - } |
398 | | - |
399 | | - /* Naive implementation! */ |
400 | | - scidd.scid = gossmap_chan_scid(rq->gossmap, chan); |
401 | | - scidd.dir = dir; |
402 | | - *max = AMOUNT_MSAT(-1ULL); |
403 | | - |
404 | | - /* Look through layers for any constraints (might be dummy |
405 | | - * ones, for created channels!) */ |
406 | | - for (size_t i = 0; i < tal_count(rq->layers); i++) |
407 | | - layer_apply_constraints(rq->layers[i], &scidd, min, max); |
408 | | - |
409 | | - /* Might be here because it's reserved, but capacity is normal. */ |
410 | | - if (amount_msat_eq(*max, AMOUNT_MSAT(-1ULL))) |
411 | | - *max = gossmap_chan_get_capacity(rq->gossmap, chan); |
412 | | - |
413 | | - /* Finally, if any is in use, subtract that! */ |
414 | | - reserve_sub(rq->reserved, &scidd, rq->layers, min); |
415 | | - reserve_sub(rq->reserved, &scidd, rq->layers, max); |
416 | | -} |
417 | | - |
418 | 371 | static void process_child_logs(struct command *cmd, |
419 | 372 | int log_fd) |
420 | 373 | { |
|
0 commit comments