multi: introduce new paymentsDB package

We introduce a new package paymentsDB and start by moving the
payment specifc errors from the channeldb package to the
paymentsDB package. We also fix linter issues which showed up
due to changing this code part.
This commit is contained in:
ziggie committed 2025-08-11 16:44:14 +02:00
1 parent db2c50a599
commit 18afd4442d
12 files changed
+279 -261

No files matched your search

+3 -2
View File
@@ -24,6 +24,7 @@ import (
"github.com/lightningnetwork/lnd/lnutils"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
paymentsdb "github.com/lightningnetwork/lnd/payments/db"
"github.com/lightningnetwork/lnd/record"
"github.com/lightningnetwork/lnd/routing/route"
"github.com/lightningnetwork/lnd/routing/shards"
@@ -1133,8 +1134,8 @@ func (r *ChannelRouter) sendToRoute(htlcHash lntypes.Hash, rt *route.Route,
switch {
// If this is an MPP attempt and the hash is already registered with
// the database, we can go on to launch the shard.
case mpp != nil && errors.Is(err, channeldb.ErrPaymentInFlight):
case mpp != nil && errors.Is(err, channeldb.ErrPaymentExists):
case mpp != nil && errors.Is(err, paymentsdb.ErrPaymentInFlight):
case mpp != nil && errors.Is(err, paymentsdb.ErrPaymentExists):
// Any other error is not tolerated.
case err != nil: