mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 18:10:48 +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:
@ -382,7 +382,7 @@ func TestBasicGraphPathFinding(t *testing.T) {
|
||||
t.Fatalf("expected outgoing time-lock of %v, instead have %v",
|
||||
1, route.Hops[0].OutgoingTimeLock)
|
||||
}
|
||||
if route.Hops[1].OutgoingTimeLock != 1 {
|
||||
if route.Hops[1].OutgoingTimeLock != 101 {
|
||||
t.Fatalf("outgoing time-lock for final hop is incorrect: "+
|
||||
"expected %v, got %v", 1, route.Hops[1].OutgoingTimeLock)
|
||||
}
|
||||
|
Reference in New Issue
Block a user