mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 00:13:37 +02:00
rpcserver: thread payreq to PaymentCreationInfo
This commit is contained in:
@@ -2875,6 +2875,7 @@ type rpcPaymentIntent struct {
|
|||||||
cltvDelta uint16
|
cltvDelta uint16
|
||||||
routeHints [][]zpay32.HopHint
|
routeHints [][]zpay32.HopHint
|
||||||
outgoingChannelID *uint64
|
outgoingChannelID *uint64
|
||||||
|
payReq []byte
|
||||||
|
|
||||||
route *route.Route
|
route *route.Route
|
||||||
}
|
}
|
||||||
@@ -2963,6 +2964,7 @@ func extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPaymentIntent, error
|
|||||||
copy(payIntent.dest[:], destKey)
|
copy(payIntent.dest[:], destKey)
|
||||||
payIntent.cltvDelta = uint16(payReq.MinFinalCLTVExpiry())
|
payIntent.cltvDelta = uint16(payReq.MinFinalCLTVExpiry())
|
||||||
payIntent.routeHints = payReq.RouteHints
|
payIntent.routeHints = payReq.RouteHints
|
||||||
|
payIntent.payReq = []byte(rpcPayReq.PaymentRequest)
|
||||||
|
|
||||||
return payIntent, nil
|
return payIntent, nil
|
||||||
}
|
}
|
||||||
@@ -3071,6 +3073,7 @@ func (r *rpcServer) dispatchPaymentIntent(
|
|||||||
PaymentHash: payIntent.rHash,
|
PaymentHash: payIntent.rHash,
|
||||||
RouteHints: payIntent.routeHints,
|
RouteHints: payIntent.routeHints,
|
||||||
OutgoingChannelID: payIntent.outgoingChannelID,
|
OutgoingChannelID: payIntent.outgoingChannelID,
|
||||||
|
PaymentRequest: payIntent.payReq,
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the final CLTV value was specified, then we'll use that
|
// If the final CLTV value was specified, then we'll use that
|
||||||
@@ -4149,6 +4152,7 @@ func (r *rpcServer) ListPayments(ctx context.Context,
|
|||||||
Path: path,
|
Path: path,
|
||||||
Fee: int64(route.TotalFees().ToSatoshis()),
|
Fee: int64(route.TotalFees().ToSatoshis()),
|
||||||
PaymentPreimage: hex.EncodeToString(preimage[:]),
|
PaymentPreimage: hex.EncodeToString(preimage[:]),
|
||||||
|
PaymentRequest: string(payment.Info.PaymentRequest),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user