Skip to content

Commit

Permalink
[PSL-1187] updated payload to handle empty burn txid/txids
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rafique committed Jun 27, 2024
1 parent b9f711f commit 3a955d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions walletnode/api/services/cascade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3a955d6

Please sign in to comment.