askrene: remove struct flow probability member.

Simply calculate it when we need it, which means we don't have to keep it
up-to-date as we tweak the flow.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-09-18 17:13:27 +09:30
parent 923e37a545
commit 829954ac71
3 changed files with 2 additions and 6 deletions

View file

@ -380,8 +380,7 @@ static const char *get_routes(const tal_t *ctx,
u32 delay;
(*routes)[i] = r = tal(*routes, struct route);
/* FIXME: flow_probability doesn't take into account other flows! */
r->success_prob = flows[i]->success_prob;
r->success_prob = flow_probability(flows[i], rq);
r->hops = tal_arr(r, struct route_hop, tal_count(flows[i]->path));
/* Fill in backwards to calc amount and delay */

View file

@ -13,8 +13,7 @@ struct flow {
const struct gossmap_chan **path;
/* The directions to traverse. */
int *dirs;
/* Amounts for this flow (fees mean this shrinks across path). */
double success_prob;
/* Amount delivered */
struct amount_msat amount;
};

View file

@ -1276,8 +1276,6 @@ get_flow_paths(const tal_t *ctx,
excess = amount_msat(0);
fp->amount = delivered;
fp->success_prob = flow_probability(fp, rq);
// add fp to flows
tal_arr_expand(&flows, fp);
}