multi: move payment related code into own package

This commit moves most of the code into its own package. It is
the smallest code move possible without moving import cycles and
keeping the changes to the code base as small as possible during
refactor.
This commit is contained in:
ziggie committed 2025-08-14 19:53:15 +02:00
1 parent 77a6b577eb
commit 03af9858d2
26 files changed
+1075 -948

No files matched your search

+4 -5
View File
@@ -15,7 +15,6 @@ import (
"github.com/btcsuite/btcd/wire"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/lightningnetwork/lnd/aliasmgr"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/fn/v2"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"
@@ -927,7 +926,7 @@ func (s *Server) SendToRouteV2(ctx context.Context,
return nil, err
}
var attempt *channeldb.HTLCAttempt
var attempt *paymentsdb.HTLCAttempt
// Pass route to the router. This call returns the full htlc attempt
// information as it is stored in the database. It is possible that both
@@ -1449,17 +1448,17 @@ func (s *Server) trackPaymentStream(context context.Context,
// No more payment updates.
return nil
}
result := item.(*channeldb.MPPayment)
result := item.(*paymentsdb.MPPayment)
log.Tracef("Payment %v updated to state %v",
result.Info.PaymentIdentifier, result.Status)
// Skip in-flight updates unless requested.
if noInflightUpdates {
if result.Status == channeldb.StatusInitiated {
if result.Status == paymentsdb.StatusInitiated {
continue
}
if result.Status == channeldb.StatusInFlight {
if result.Status == paymentsdb.StatusInFlight {
continue
}
}