@@ -628,7 +628,6 @@ func (s *SQLStore) DeletePayment(paymentHash lntypes.Hash,
628628 // Be careful to not use s.db here, because we are in a
629629 // transaction, is there a way to make this more secure?
630630 return db .DeletePayment (ctx , fetchPayment .Payment .ID )
631-
632631 }, func () {
633632 })
634633 if err != nil {
@@ -813,26 +812,31 @@ func (s *SQLStore) insertRouteHops(ctx context.Context, db SQLQueries,
813812 // Insert the per-hop custom records
814813 if len (hop .CustomRecords ) > 0 {
815814 for key , value := range hop .CustomRecords {
816- err = db .InsertPaymentHopCustomRecord (ctx , sqlc.InsertPaymentHopCustomRecordParams {
817- HopID : hopID ,
818- Key : int64 (key ),
819- Value : value ,
820- })
815+ err = db .InsertPaymentHopCustomRecord (ctx ,
816+ sqlc.InsertPaymentHopCustomRecordParams {
817+ HopID : hopID ,
818+ Key : int64 (key ),
819+ Value : value ,
820+ },
821+ )
821822 if err != nil {
822823 return fmt .Errorf ("failed to insert " +
823- "payment hop custom record: %w" , err )
824+ "payment hop custom " +
825+ "records: %w" , err )
824826 }
825827 }
826828 }
827829
828830 // Insert MPP data if present
829831 if hop .MPP != nil {
830832 paymentAddr := hop .MPP .PaymentAddr ()
831- err = db .InsertRouteHopMpp (ctx , sqlc.InsertRouteHopMppParams {
832- HopID : hopID ,
833- PaymentAddr : paymentAddr [:],
834- TotalMsat : int64 (hop .MPP .TotalMsat ()),
835- })
833+ err = db .InsertRouteHopMpp (ctx ,
834+ sqlc.InsertRouteHopMppParams {
835+ HopID : hopID ,
836+ PaymentAddr : paymentAddr [:],
837+ TotalMsat : int64 (hop .MPP .TotalMsat ()),
838+ },
839+ )
836840 if err != nil {
837841 return fmt .Errorf ("failed to insert " +
838842 "route hop MPP: %w" , err )
@@ -843,11 +847,13 @@ func (s *SQLStore) insertRouteHops(ctx context.Context, db SQLQueries,
843847 if hop .AMP != nil {
844848 rootShare := hop .AMP .RootShare ()
845849 setID := hop .AMP .SetID ()
846- err = db .InsertRouteHopAmp (ctx , sqlc.InsertRouteHopAmpParams {
847- HopID : hopID ,
848- RootShare : rootShare [:],
849- SetID : setID [:],
850- })
850+ err = db .InsertRouteHopAmp (ctx ,
851+ sqlc.InsertRouteHopAmpParams {
852+ HopID : hopID ,
853+ RootShare : rootShare [:],
854+ SetID : setID [:],
855+ },
856+ )
851857 if err != nil {
852858 return fmt .Errorf ("failed to insert " +
853859 "route hop AMP: %w" , err )
@@ -946,6 +952,7 @@ func (s *SQLStore) RegisterAttempt(paymentHash lntypes.Hash,
946952
947953 for key , value := range attemptFirstHopCustomRecords {
948954 err = db .InsertPaymentAttemptFirstHopCustomRecord (ctx ,
955+ //nolint:ll
949956 sqlc.InsertPaymentAttemptFirstHopCustomRecordParams {
950957 HtlcAttemptIndex : int64 (attempt .AttemptID ),
951958 Key : int64 (key ),
@@ -1081,9 +1088,12 @@ func (s *SQLStore) FailAttempt(paymentHash lntypes.Hash,
10811088 return fmt .Errorf ("failed to fail attempt: %w" , err )
10821089 }
10831090
1084- mpPayment , err = s .fetchPaymentWithCompleteData (ctx , db , payment )
1091+ mpPayment , err = s .fetchPaymentWithCompleteData (
1092+ ctx , db , payment ,
1093+ )
10851094 if err != nil {
1086- return fmt .Errorf ("failed to fetch payment with complete data: %w" , err )
1095+ return fmt .Errorf ("failed to fetch payment with" +
1096+ "complete data: %w" , err )
10871097 }
10881098
10891099 return nil
@@ -1232,7 +1242,6 @@ func (s *SQLStore) DeletePayments(failedOnly, failedHtlcsOnly bool) (int,
12321242 ctx , s .cfg .QueryCfg , int64 (- 1 ), queryFunc ,
12331243 extractCursor , processPayment ,
12341244 )
1235-
12361245 }, func () {
12371246 numPayments = 0
12381247 })
0 commit comments