Skip to content

Commit 56dd8fd

Browse files
committed
askrene: expose some internal API of refine
Expose some internal API of refine so that we can have more control on how to fix flow constraints. Changelog-None Signed-off-by: Lagrang3 <[email protected]>
1 parent f474d81 commit 56dd8fd

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

plugins/askrene/refine.c

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

29-
static struct reserve_hop *new_reservations(const tal_t *ctx,
30-
const struct route_query *rq)
29+
struct reserve_hop *new_reservations(const tal_t *ctx,
30+
const struct route_query *rq)
3131
{
3232
struct reserve_hop *rhops = tal_arr(ctx, struct reserve_hop, 0);
3333

@@ -99,9 +99,9 @@ static void subtract_reservation(struct reserve_hop **reservations,
9999
reserve_add(askrene->reserved, prev, rq->cmd->id);
100100
}
101101

102-
static void create_flow_reservations(const struct route_query *rq,
103-
struct reserve_hop **reservations,
104-
const struct flow *flow)
102+
void create_flow_reservations(const struct route_query *rq,
103+
struct reserve_hop **reservations,
104+
const struct flow *flow)
105105
{
106106
struct amount_msat msat;
107107

plugins/askrene/refine.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,14 @@ refine_with_fees_and_limits(const tal_t *ctx,
2323
struct amount_msat deliver,
2424
struct flow ***flows,
2525
double *flowset_probability);
26+
27+
/* Create a new set of temporary reservations.
28+
* Reservations are removed on destruction. */
29+
struct reserve_hop *new_reservations(const tal_t *ctx,
30+
const struct route_query *rq);
31+
32+
/* Add a flow to an existing reservation set. */
33+
void create_flow_reservations(const struct route_query *rq,
34+
struct reserve_hop **reservations,
35+
const struct flow *flow);
2636
#endif /* LIGHTNING_PLUGINS_ASKRENE_REFINE_H */

0 commit comments

Comments
 (0)