]> git.bitcoin.ninja Git - rust-lightning/commit
Multi-Hop Route Hint as per Bolt 12 now considered
authorabhik-99 <abhik.banerjee.1999@gmail.com>
Mon, 9 Aug 2021 15:06:51 +0000 (20:36 +0530)
committerabhik-99 <abhik.banerjee.1999@gmail.com>
Tue, 31 Aug 2021 05:38:06 +0000 (11:08 +0530)
commitfd4d3bf3b76a9490c93d75a85e599989063b6575
tree720fec5a99aad9946c32ecc39521d6aa3aed56b3
parent853007800ebb433f53b5b10e1a941cc65c04e829
Multi-Hop Route Hint as per Bolt 12 now considered

Bolt 12 details the process of picking up route hints from payee
using the lightning invoice. This PR brings the changes to use
multiple route hints from payee picked from the invoice.

The route hints are processed in the following manner:-
 - `get_route()` receives the hints in `last_hops`.
 - Every `RouteHintHop` in `RouteHint` is processed based on
   feasiblity of channel capacity and fees.
 - If a `RouteHintHop` then preceeding `RouteHintHop`s are not
   processed.
 - A direct route is checked from `first_hops_targets` to the
   first `RouteHintHop` if the respective `RouteHint` is
   processed from the payee's end till the first `RouteHintHop`.

`partial_route_hint_test`, `ignores_empty_last_hops_test`,
`multi_hint_last_hops_test` and `last_hops_with_public_channel_test`
test usage of partial route hints for building optimal route,
processing empty route hint hops, complete usage of private route
hints and presence of public channels in route hints respectively.

Resolves: #945
.gitignore
lightning/src/routing/router.rs