zpay32: move HopHint and DefaultFinalCLTVDelta
This commit is contained in:
11 files changed
+70
-66
No files matched your search
+4
-7
@@ -25,13 +25,10 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/multimutex"
|
||||
"github.com/lightningnetwork/lnd/routing/chainview"
|
||||
"github.com/lightningnetwork/lnd/zpay32"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultFinalCLTVDelta is the default value to be used as the final
|
||||
// CLTV delta for a route if one is unspecified.
|
||||
DefaultFinalCLTVDelta = 9
|
||||
|
||||
// defaultPayAttemptTimeout is a duration that we'll use to determine
|
||||
// if we should give up on a payment attempt. This will be used if a
|
||||
// value isn't specified in the LightningNode struct.
|
||||
@@ -1331,7 +1328,7 @@ func (r *ChannelRouter) FindRoutes(source, target Vertex,
|
||||
|
||||
var finalCLTVDelta uint16
|
||||
if len(finalExpiry) == 0 {
|
||||
finalCLTVDelta = DefaultFinalCLTVDelta
|
||||
finalCLTVDelta = zpay32.DefaultFinalCLTVDelta
|
||||
} else {
|
||||
finalCLTVDelta = finalExpiry[0]
|
||||
}
|
||||
@@ -1551,7 +1548,7 @@ type LightningPayment struct {
|
||||
// multiple routes, ensure the hop hints within each route are chained
|
||||
// together and sorted in forward order in order to reach the
|
||||
// destination successfully.
|
||||
RouteHints [][]HopHint
|
||||
RouteHints [][]zpay32.HopHint
|
||||
|
||||
// OutgoingChannelID is the channel that needs to be taken to the first
|
||||
// hop. If nil, any channel may be used.
|
||||
@@ -1628,7 +1625,7 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
|
||||
|
||||
var finalCLTVDelta uint16
|
||||
if payment.FinalCLTVDelta == nil {
|
||||
finalCLTVDelta = DefaultFinalCLTVDelta
|
||||
finalCLTVDelta = zpay32.DefaultFinalCLTVDelta
|
||||
} else {
|
||||
finalCLTVDelta = *payment.FinalCLTVDelta
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user