Skip to content

Commit

Permalink
pending scr check
Browse files Browse the repository at this point in the history
  • Loading branch information
miiu96 committed Aug 6, 2024
1 parent 1a3f2e8 commit 68d5dc0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions process/transactionProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,12 @@ func (tp *TransactionProcessor) computeTransactionStatus(tx *transaction.ApiTran
}
}

if hasPendingSCR(allScrs) {
return &data.ProcessStatusResponse{
Status: string(transaction.TxStatusPending),
}
}

allLogs, err = tp.addMissingLogsOnProcessingExceptions(tx, allLogs, allScrs)
if err != nil {
log.Warn("error in TransactionProcessor.computeTransactionStatus on addMissingLogsOnProcessingExceptions call", "error", err)
Expand Down Expand Up @@ -507,6 +513,16 @@ func (tp *TransactionProcessor) computeTransactionStatus(tx *transaction.ApiTran
}
}

func hasPendingSCR(scrs []*transaction.ApiTransactionResult) bool {
for _, scr := range scrs {
if scr.Status == transaction.TxStatusPending {
return true
}
}

return false
}

func checkIfFailed(logs []*transaction.ApiLogs) (bool, string) {
found, reason := findIdentifierInLogs(logs, internalVMErrorsEventIdentifier)
if found {
Expand Down

0 comments on commit 68d5dc0

Please sign in to comment.