diff --git a/walletnode/api/services/cascade.go b/walletnode/api/services/cascade.go index a79144e1d..13d3c3f47 100644 --- a/walletnode/api/services/cascade.go +++ b/walletnode/api/services/cascade.go @@ -139,15 +139,15 @@ func (service *CascadeAPIHandler) StartProcessing(ctx context.Context, p *cascad } sortedBurnTxids, err := service.register.SortBurnTxIDs(ctx, p.BurnTxids) - if err == nil { + if err != nil { return nil, cascade.MakeInternalServerError(err) } sortedRelatedFiles := service.register.SortFilesWithHigherAmounts(relatedFiles) - if err == nil { - return nil, cascade.MakeInternalServerError(err) + if len(sortedRelatedFiles) < 1 { + log.WithContext(ctx).WithField("sorted_related_files", sortedRelatedFiles).Info("Sorted related files") + return nil, cascade.MakeInternalServerError(errors.New("Sorted related files")) } - log.WithContext(ctx).WithField("sorted_related_files", sortedRelatedFiles).Info("Sorted related files") var taskIDs string for index, file := range relatedFiles {