mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-11 09:42:58 +02:00
routing: hop-payload for last hop should be the absolute timeout, not delta
This commit fixes an oversight in the path finding code when converting a path into a route. Currently, for the last hop, we’d emplace the expiry delta of the last hop within the per-hop payload. This was left over from a prior version of the specification. To fix this, we’ll now emplace the _absolute_ final HTLC expiry with the payload, such that, the final hop that verify that the HTLC has not been tampered with in flight.
This commit is contained in:
@@ -1002,6 +1002,7 @@ func (r *ChannelRouter) SendPayment(payment *LightningPayment) ([32]byte, *Route
|
||||
// payment amount. If no such routes can be found then an error will be
|
||||
// returned.
|
||||
if !ok {
|
||||
// TODO(roasbeef): put cache handling into FindRoutes
|
||||
freshRoutes, err := r.FindRoutes(payment.Target, payment.Amount)
|
||||
if err != nil {
|
||||
return preImage, nil, err
|
||||
|
Reference in New Issue
Block a user