mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
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:
parent
923e37a545
commit
829954ac71
3 changed files with 2 additions and 6 deletions
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue