mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-30 07:58:15 +01:00
multi: enforce routing.MinCLTVDelta=18 for invoices + chanupd
This commit clamps all user-chosen CLTVs in LND to be at least 18, which is the new conservative value used in the sepc. This minimum is applied uniformly to forwarding CLTV deltas (via channel updates) as well as final CLTV deltas for new invoices.
This commit is contained in:
@@ -23,7 +23,6 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/record"
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
"github.com/lightningnetwork/lnd/zpay32"
|
||||
)
|
||||
|
||||
var uniquePaymentID uint64 = 1 // to be used atomically
|
||||
@@ -223,7 +222,7 @@ func TestFindRoutesWithFeeLimit(t *testing.T) {
|
||||
route, err := ctx.router.FindRoute(
|
||||
ctx.router.selfNode.PubKeyBytes,
|
||||
target, paymentAmt, restrictions, nil, nil,
|
||||
zpay32.DefaultFinalCLTVDelta,
|
||||
MinCLTVDelta,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to find any routes: %v", err)
|
||||
@@ -1284,7 +1283,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
_, err = ctx.router.FindRoute(
|
||||
ctx.router.selfNode.PubKeyBytes,
|
||||
targetPubKeyBytes, paymentAmt, noRestrictions, nil, nil,
|
||||
zpay32.DefaultFinalCLTVDelta,
|
||||
MinCLTVDelta,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to find any routes: %v", err)
|
||||
@@ -1327,7 +1326,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
_, err = ctx.router.FindRoute(
|
||||
ctx.router.selfNode.PubKeyBytes,
|
||||
targetPubKeyBytes, paymentAmt, noRestrictions, nil, nil,
|
||||
zpay32.DefaultFinalCLTVDelta,
|
||||
MinCLTVDelta,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to find any routes: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user