Skip to content

Commit 453467a

Browse files
committed
askrene: refine: expose some of the refine API
that can be useful for us in the mcf.c main loop. Changelog-None Signed-off-by: Lagrang3 <[email protected]>
1 parent 1f0d488 commit 453467a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

plugins/askrene/refine.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ static void destroy_reservations(struct reserve_hop *rhops, struct askrene *askr
3535
reserve_remove(askrene->reserved, &rhops[i]);
3636
}
3737

38-
static struct reserve_hop *new_reservations(const tal_t *ctx,
39-
const struct route_query *rq)
38+
struct reserve_hop *new_reservations(const tal_t *ctx,
39+
const struct route_query *rq)
4040
{
4141
struct reserve_hop *rhops = tal_arr(ctx, struct reserve_hop, 0);
4242

@@ -108,9 +108,9 @@ static void subtract_reservation(struct reserve_hop **reservations,
108108
reserve_add(askrene->reserved, prev, rq->cmd->id);
109109
}
110110

111-
static void create_flow_reservations(const struct route_query *rq,
112-
struct reserve_hop **reservations,
113-
const struct flow *flow)
111+
void create_flow_reservations(const struct route_query *rq,
112+
struct reserve_hop **reservations,
113+
const struct flow *flow)
114114
{
115115
struct amount_msat msat;
116116

plugins/askrene/refine.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ struct route_query;
77
struct amount_msat;
88
struct flow;
99

10+
struct reserve_hop *new_reservations(const tal_t *ctx,
11+
const struct route_query *rq);
12+
13+
void create_flow_reservations(const struct route_query *rq,
14+
struct reserve_hop **reservations,
15+
const struct flow *flow);
16+
1017
/* We got an answer from min-cost-flow, but we now need to:
1118
* 1. Add fixup exact delivery amounts since MCF deals in larger granularity than msat.
1219
* 2. Add fees which accumulate through the route.

0 commit comments

Comments
 (0)