diff --git a/common/dijkstra.c b/common/dijkstra.c index a0fbef341778..4f7c8bcd0c36 100644 --- a/common/dijkstra.c +++ b/common/dijkstra.c @@ -144,6 +144,7 @@ dijkstra_(const tal_t *ctx, u64 (*path_score)(u32 distance, struct amount_msat cost, struct amount_msat risk, + int dir, const struct gossmap_chan *c), void *arg) { @@ -251,7 +252,7 @@ dijkstra_(const tal_t *ctx, risk = risk_price(cost, riskfactor, cur_d->total_delay + c->half[!which_half].delay); - score = path_score(cur_d->distance + 1, cost, risk, c); + score = path_score(cur_d->distance + 1, cost, risk, !which_half, c); if (score >= d->score) continue; diff --git a/common/dijkstra.h b/common/dijkstra.h index 4a43d99b819a..7708b50e9f02 100644 --- a/common/dijkstra.h +++ b/common/dijkstra.h @@ -24,6 +24,7 @@ dijkstra_(const tal_t *ctx, u64 (*path_score)(u32 distance, struct amount_msat cost, struct amount_msat risk, + int dir, const struct gossmap_chan *c), void *arg); diff --git a/common/route.c b/common/route.c index a772aaa1d95c..97ab124b84b4 100644 --- a/common/route.c +++ b/common/route.c @@ -52,6 +52,7 @@ static u32 costs_to_score(struct amount_msat cost, u64 route_score_shorter(u32 distance, struct amount_msat cost, struct amount_msat risk, + int dir UNUSED, const struct gossmap_chan *c UNUSED) { return costs_to_score(cost, risk) + ((u64)distance << 32); @@ -61,6 +62,7 @@ u64 route_score_shorter(u32 distance, u64 route_score_cheaper(u32 distance, struct amount_msat cost, struct amount_msat risk, + int dir UNUSED, const struct gossmap_chan *c UNUSED) { return ((u64)costs_to_score(cost, risk) << 32) + distance; diff --git a/common/route.h b/common/route.h index 5528d5390c14..1fc474234da3 100644 --- a/common/route.h +++ b/common/route.h @@ -57,12 +57,14 @@ bool route_can_carry_even_disabled(const struct gossmap *map, u64 route_score_shorter(u32 distance, struct amount_msat cost, struct amount_msat risk, + int dir UNUSED, const struct gossmap_chan *c UNUSED); /* Cheapest path, with shorter path tiebreak */ u64 route_score_cheaper(u32 distance, struct amount_msat cost, struct amount_msat risk, + int dir UNUSED, const struct gossmap_chan *c UNUSED); /* Extract route tal_arr from completed dijkstra: NULL if none. */ diff --git a/plugins/topology.c b/plugins/topology.c index 4376e56e1150..bd4a2b3e62e4 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -52,6 +52,7 @@ struct exclude_entry { static u64 route_score_fuzz(u32 distance, struct amount_msat cost, struct amount_msat risk, + int dir UNUSED, const struct gossmap_chan *c) { u64 costs = cost.millisatoshis + risk.millisatoshis; /* Raw: score */