routing: dont include final hop cltv in blinded path

Only include the final hop's cltv delta in the total timelock
calculation if the route does not include a blinded path. This is
because in a blinded path, the final hops final cltv delta will be
included in the blinded path's accumlated cltv delta value.

With this commit, we remove the responsibility of remembering not to set
the `finalHop.cltvDelta` from the caller of `newRoute`. The relevant
test is updated accordingly.
This commit is contained in:
Elle Mouton
2024-05-07 12:16:17 +02:00
parent 93f89512ae
commit cd3da40fb9
4 changed files with 52 additions and 14 deletions

View File

@@ -156,6 +156,10 @@ type Invoice struct {
// This field is un-exported and can only be read by the
// MinFinalCLTVExpiry() method. By forcing callers to read via this
// method, we can easily enforce the default if not specified.
//
// NOTE: this field is ignored in the case that the invoice contains
// blinded paths since then the final minimum cltv expiry delta is
// expected to be included in the route's accumulated CLTV delta value.
minFinalCLTVExpiry *uint64
// Description is a short description of the purpose of this invoice.