Undo route changes above */
| 585 | |
| 586 | /* Undo route changes above */ |
| 587 | static void payment_chanhints_unapply_route(struct payment *p) |
| 588 | { |
| 589 | struct payment *root = payment_root(p); |
| 590 | |
| 591 | for (size_t i = 0; i < tal_count(p->route); i++) { |
| 592 | struct route_hop *curhop; |
| 593 | struct channel_hint *curhint; |
| 594 | |
| 595 | curhop = &p->route[i]; |
| 596 | curhint = payment_chanhints_get(root, curhop); |
| 597 | if (!curhint) |
| 598 | continue; |
| 599 | |
| 600 | /* Update the number of htlcs for any local |
| 601 | * channel in the route */ |
| 602 | if (curhint->local) |
| 603 | curhint->local->htlc_budget++; |
| 604 | |
| 605 | if (!amount_msat_accumulate(&curhint->estimated_capacity, |
| 606 | curhop->amount)) { |
| 607 | /* This should never happen, it'd mean |
| 608 | * that we unapply a route that would |
| 609 | * result in a msatoshi |
| 610 | * wrap-around. */ |
| 611 | abort(); |
| 612 | } |
| 613 | } |
| 614 | } |
| 615 | |
| 616 | static const struct short_channel_id_dir * |
| 617 | payment_get_excluded_channels(const tal_t *ctx, struct payment *p) |
no test coverage detected