Include PaymentPathRetry data in PaymentPathFailed
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 21 Oct 2021 22:52:53 +0000 (17:52 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 25 Oct 2021 15:18:11 +0000 (10:18 -0500)
commit46b68c517dba57bde545ea8e56b47fe3af768579
treecd63d511971927fb789065551a729aa37b6a74a2
parent8b9cf93b11c49ab8726d807a72c083367dda356e
Include PaymentPathRetry data in PaymentPathFailed

When a payment path fails, it may be retried. Typically, this means
re-computing the route after updating the NetworkGraph and channel
scores in order to avoid the failing hop. The last hop in
PaymentPathFailed's path field contains the pubkey, amount, and CLTV
values needed to pass to get_route. However, it does not contain the
payee's features and route hints from the invoice.

Include the entire set of parameters in PaymentPathRetry and add it to
the PaymentPathFailed event. Add a get_retry_route wrapper around
get_route that takes PaymentPathRetry. This allows an EventHandler to
retry failed payment paths using the payee's route hints and features.
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/onion_route_tests.rs
lightning/src/routing/network_graph.rs
lightning/src/routing/router.rs
lightning/src/util/events.rs