mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-28 05:57:50 +02:00
routerrpc: update final cltv delta default
The default was increased for the main sendpayment RPC in commit
d3fa9767a9
. This commit sets the
same default for QueryRoutes, routerrpc.SendPayment and
router.EstimateRouteFee.
This commit is contained in:
@@ -2110,6 +2110,7 @@ func TestPathFindSpecExample(t *testing.T) {
|
||||
const amt lnwire.MilliSatoshi = 4999999
|
||||
route, err := ctx.router.FindRoute(
|
||||
bobNode.PubKeyBytes, carol, amt, noRestrictions, nil, nil,
|
||||
zpay32.DefaultFinalCLTVDelta,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to find route: %v", err)
|
||||
@@ -2165,6 +2166,7 @@ func TestPathFindSpecExample(t *testing.T) {
|
||||
// We'll now request a route from A -> B -> C.
|
||||
route, err = ctx.router.FindRoute(
|
||||
source.PubKeyBytes, carol, amt, noRestrictions, nil, nil,
|
||||
zpay32.DefaultFinalCLTVDelta,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to find routes: %v", err)
|
||||
|
@@ -1403,14 +1403,7 @@ func (r *ChannelRouter) FindRoute(source, target route.Vertex,
|
||||
amt lnwire.MilliSatoshi, restrictions *RestrictParams,
|
||||
destCustomRecords record.CustomSet,
|
||||
routeHints map[route.Vertex][]*channeldb.ChannelEdgePolicy,
|
||||
finalExpiry ...uint16) (*route.Route, error) {
|
||||
|
||||
var finalCLTVDelta uint16
|
||||
if len(finalExpiry) == 0 {
|
||||
finalCLTVDelta = zpay32.DefaultFinalCLTVDelta
|
||||
} else {
|
||||
finalCLTVDelta = finalExpiry[0]
|
||||
}
|
||||
finalExpiry uint16) (*route.Route, error) {
|
||||
|
||||
log.Debugf("Searching for path to %v, sending %v", target, amt)
|
||||
|
||||
@@ -1441,7 +1434,7 @@ func (r *ChannelRouter) FindRoute(source, target route.Vertex,
|
||||
|
||||
// Now that we know the destination is reachable within the graph, we'll
|
||||
// execute our path finding algorithm.
|
||||
finalHtlcExpiry := currentHeight + int32(finalCLTVDelta)
|
||||
finalHtlcExpiry := currentHeight + int32(finalExpiry)
|
||||
|
||||
path, err := findPath(
|
||||
&graphParams{
|
||||
@@ -1461,7 +1454,7 @@ func (r *ChannelRouter) FindRoute(source, target route.Vertex,
|
||||
source, path, uint32(currentHeight),
|
||||
finalHopParams{
|
||||
amt: amt,
|
||||
cltvDelta: finalCLTVDelta,
|
||||
cltvDelta: finalExpiry,
|
||||
records: destCustomRecords,
|
||||
},
|
||||
)
|
||||
|
Reference in New Issue
Block a user