From bfd59aac224e73a39fb5f957b9d869f980bf8549 Mon Sep 17 00:00:00 2001 From: ziggie Date: Fri, 17 Oct 2025 09:23:49 +0200 Subject: [PATCH] paymentsdb: add more comments --- lnrpc/routerrpc/router_backend.go | 4 ++++ payments/db/sql_converters.go | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lnrpc/routerrpc/router_backend.go b/lnrpc/routerrpc/router_backend.go index d8c8a17c4..3085f587d 100644 --- a/lnrpc/routerrpc/router_backend.go +++ b/lnrpc/routerrpc/router_backend.go @@ -1767,6 +1767,10 @@ func (r *RouterBackend) MarshallPayment(payment *paymentsdb.MPPayment) ( // If any of the htlcs have settled, extract a valid // preimage. 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 fee += htlc.Route.TotalFees() } diff --git a/payments/db/sql_converters.go b/payments/db/sql_converters.go index fd0cad2dc..66f3b1d3a 100644 --- a/payments/db/sql_converters.go +++ b/payments/db/sql_converters.go @@ -27,8 +27,10 @@ func dbPaymentToCreationInfo(paymentIdentifier []byte, amountMsat int64, copy(identifier[:], paymentIdentifier) return &PaymentCreationInfo{ - PaymentIdentifier: identifier, - Value: lnwire.MilliSatoshi(amountMsat), + PaymentIdentifier: identifier, + 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(), PaymentRequest: intentPayload, 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 { pubKey, err := btcec.ParsePubKey(hop.BlindingPoint) if err != nil {