diff --git a/payments/db/errors.go b/payments/db/errors.go index 0457db600..3b4e25bd9 100644 --- a/payments/db/errors.go +++ b/payments/db/errors.go @@ -136,6 +136,11 @@ var ( ErrNoDuplicateNestedBucket = errors.New("nested duplicate bucket not " + "found") + // ErrNoDuplicateSequenceNumber is returned when a duplicate payment + // sub-bucket does not contain the sequence number key. + ErrNoDuplicateSequenceNumber = errors.New("duplicate payment " + + "sequence number not found") + // ErrNoSequenceNrIndex is returned when an attempt to lookup a payment // index is made for a sequence number that is not indexed. // diff --git a/payments/db/kv_store.go b/payments/db/kv_store.go index 6d21048d7..b3fffe1e1 100644 --- a/payments/db/kv_store.go +++ b/payments/db/kv_store.go @@ -1236,7 +1236,7 @@ func fetchPaymentWithSequenceNumber(tx kvdb.RTx, paymentHash lntypes.Hash, seqBytes := subBucket.Get(duplicatePaymentSequenceKey) if seqBytes == nil { - return err + return ErrNoDuplicateSequenceNumber } // If this duplicate payment is not the sequence number we are