paymentsdb: add more comments
This commit is contained in:
2 files changed
+10
-3
No files matched your search
@@ -1767,6 +1767,10 @@ func (r *RouterBackend) MarshallPayment(payment *paymentsdb.MPPayment) (
|
|||||||
// If any of the htlcs have settled, extract a valid
|
// If any of the htlcs have settled, extract a valid
|
||||||
// preimage.
|
// preimage.
|
||||||
if htlc.Settle != nil {
|
if htlc.Settle != nil {
|
||||||
|
// For AMP payments all hashes will be different so we
|
||||||
|
// will only show the last htlc preimage, this is a
|
||||||
|
// current limitation for AMP payments because for
|
||||||
|
// MPP payments all hashes are the same.
|
||||||
preimage = htlc.Settle.Preimage
|
preimage = htlc.Settle.Preimage
|
||||||
fee += htlc.Route.TotalFees()
|
fee += htlc.Route.TotalFees()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,10 @@ func dbPaymentToCreationInfo(paymentIdentifier []byte, amountMsat int64,
|
|||||||
copy(identifier[:], paymentIdentifier)
|
copy(identifier[:], paymentIdentifier)
|
||||||
|
|
||||||
return &PaymentCreationInfo{
|
return &PaymentCreationInfo{
|
||||||
PaymentIdentifier: identifier,
|
PaymentIdentifier: identifier,
|
||||||
Value: lnwire.MilliSatoshi(amountMsat),
|
Value: lnwire.MilliSatoshi(amountMsat),
|
||||||
|
// The creation time is stored in the database as UTC but here
|
||||||
|
// we convert it to local time.
|
||||||
CreationTime: createdAt.Local(),
|
CreationTime: createdAt.Local(),
|
||||||
PaymentRequest: intentPayload,
|
PaymentRequest: intentPayload,
|
||||||
FirstHopCustomRecords: firstHopCustomRecords,
|
FirstHopCustomRecords: firstHopCustomRecords,
|
||||||
@@ -205,7 +207,8 @@ func dbDataToRoute(hops []sqlc.FetchHopsForAttemptsRow,
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add blinding point if present (only for introduction node).
|
// Add blinding point if present (only for introduction node
|
||||||
|
// in blinded route).
|
||||||
if len(hop.BlindingPoint) > 0 {
|
if len(hop.BlindingPoint) > 0 {
|
||||||
pubKey, err := btcec.ParsePubKey(hop.BlindingPoint)
|
pubKey, err := btcec.ParsePubKey(hop.BlindingPoint)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user