dijkstra: add chan pointer argument to path scoring.

For fuzz, we will need some fixed per-channel data (so we always fuzz
a channel the same way).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-05-22 16:40:01 +09:30
parent 3832542d27
commit 46b735c023
4 changed files with 13 additions and 7 deletions

View File

@@ -143,7 +143,8 @@ dijkstra_(const tal_t *ctx,
void *arg),
u64 (*path_score)(u32 distance,
struct amount_msat cost,
struct amount_msat risk),
struct amount_msat risk,
const struct gossmap_chan *c),
void *arg)
{
struct dijkstra *dij;
@@ -250,7 +251,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);
score = path_score(cur_d->distance + 1, cost, risk, c);
if (score >= d->score)
continue;