routing+refactor: let BlindedEdge carry BlindedPayment
This commit is purely a refactor. In it, we let the `BlindedEdge` struct carry a pointer to the `BlindedPayment` that it was derived from. This is done now because later on in the PR series, we will need more information about the `BlindedPayment` that an edge was derived from. Since we now pass in the whole BlindedPayment, we swap out the `cipherText` member for a `hopIndex` member so that we dont carry around two sources of truth in the same struct.
This commit is contained in:
6 files changed
+109
-60
No files matched your search
+5
-1
@@ -2001,6 +2001,7 @@ func NewRouteRequest(source route.Vertex, target *route.Vertex,
|
||||
// Assume that we're starting off with a regular payment.
|
||||
requestHints = routeHints
|
||||
requestExpiry = finalExpiry
|
||||
err error
|
||||
)
|
||||
|
||||
if blindedPayment != nil {
|
||||
@@ -2038,7 +2039,10 @@ func NewRouteRequest(source route.Vertex, target *route.Vertex,
|
||||
requestExpiry = blindedPayment.CltvExpiryDelta
|
||||
}
|
||||
|
||||
requestHints = blindedPayment.toRouteHints()
|
||||
requestHints, err = blindedPayment.toRouteHints()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
requestTarget, err := getTargetNode(target, blindedPayment)
|
||||
|
||||
Reference in new issue
Block a user