diff --git a/services/horizon/internal/txsub/results.go b/services/horizon/internal/txsub/results.go index d85448fd89..21b5939aca 100644 --- a/services/horizon/internal/txsub/results.go +++ b/services/horizon/internal/txsub/results.go @@ -65,19 +65,5 @@ func checkTxAlreadyExists(ctx context.Context, db HorizonDB, hash, sourceAddress } defer db.Rollback() - tx, err := txResultByHash(ctx, db, hash) - if err == ErrNoResults { - var sequenceNumbers map[string]uint64 - sequenceNumbers, err = db.GetSequenceNumbers(ctx, []string{sourceAddress}) - if err != nil { - return tx, errors.Wrapf(err, "cannot fetch sequence number for %v", sourceAddress) - } - - _, ok := sequenceNumbers[sourceAddress] - if !ok { - return tx, ErrNoAccount - } - return tx, ErrNoResults - } - return tx, err + return txResultByHash(ctx, db, hash) } diff --git a/services/horizon/internal/txsub/system.go b/services/horizon/internal/txsub/system.go index 8712e5e418..3b7946cb2a 100644 --- a/services/horizon/internal/txsub/system.go +++ b/services/horizon/internal/txsub/system.go @@ -165,7 +165,9 @@ func (sys *System) Submit( } // add transaction to open list - sys.Pending.Add(ctx, hash, resultCh) + if err := sys.Pending.Add(ctx, hash, resultCh); err != nil { + sys.finish(ctx, hash, resultCh, Result{Err: err}) + } return }