paymod: Check if destination is reachable at all directly at startup

This does two things: it checks if the destination of the payment is at all
reachable without routehints, and if it is it adds a direct attempt as option
to the routehints in the form of a NULL routehint. It also simplifies the
selection of the routehint since the direct case is no longer special, instead
we just return a NULL routehint as if it were a normal routehint.
This commit is contained in:
Christian Decker
2020-07-23 10:52:08 +02:00
parent 497b18ba33
commit b78aa3fb25
2 changed files with 69 additions and 10 deletions

View File

@@ -299,6 +299,9 @@ struct routehints_data {
/* We modify the CLTV in the getroute call, so we need to remember
* what the final cltv delta was so we re-apply it correctly. */
u32 final_cltv;
/* Is the destination reachable without any routehints? */
bool destination_reachable;
};
struct exemptfee_data {