mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user