mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-09 19:14:32 +02:00
routing: let BlindedPaymentPathSet handle FinalCLTV logic
Instead of needing to remember how to handle the FinalCLTV value of a blinded payment path at various points in the code base, we hide the logic behind a unified FinalCLTVDelta method on the blinded path.
This commit is contained in:
@@ -524,17 +524,7 @@ func NewRouteRequest(source route.Vertex, target *route.Vertex,
|
||||
return nil, ErrExpiryAndBlinded
|
||||
}
|
||||
|
||||
// If we have a blinded path with 1 hop, the cltv expiry
|
||||
// will not be included in any hop hints (since we're just
|
||||
// sending to the introduction node and need no blinded hints).
|
||||
// In this case, we include it to make sure that the final
|
||||
// cltv delta is accounted for (since it's part of the blinded
|
||||
// delta). In the case of a multi-hop route, we set our final
|
||||
// cltv to zero, since it's going to be accounted for in the
|
||||
// delta for our hints.
|
||||
if len(blindedPayment.BlindedPath.BlindedHops) == 1 {
|
||||
requestExpiry = blindedPayment.CltvExpiryDelta
|
||||
}
|
||||
requestExpiry = blindedPathSet.FinalCLTVDelta()
|
||||
|
||||
requestHints, err = blindedPathSet.ToRouteHints()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user