This commit is contained in:
@@ -2,6 +2,7 @@ package settlement
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -41,7 +42,13 @@ func (w Worker) RunOnce(ctx context.Context, limit int) error {
|
||||
record.Attempts++
|
||||
hash, submitErr := w.Submitter.Submit(ctx, record)
|
||||
if submitErr != nil {
|
||||
record = record.Retry(now, w.MaxAttempts, submitErr)
|
||||
var permanent ledger.PermanentSubmissionError
|
||||
if errors.As(submitErr, &permanent) {
|
||||
record.Status = ledger.SettlementManualReview
|
||||
record.LastError = submitErr.Error()
|
||||
} else {
|
||||
record = record.Retry(now, w.MaxAttempts, submitErr)
|
||||
}
|
||||
} else {
|
||||
// Horizon returns success only after the transaction is accepted into
|
||||
// a ledger, so a successful response is already confirmation.
|
||||
|
||||
Reference in New Issue
Block a user