Skip to content

Commit

Permalink
fixed simulation - do not delete tx if failed. also fixed log
Browse files Browse the repository at this point in the history
  • Loading branch information
olegfomenko committed Mar 7, 2024
1 parent 2973108 commit 16cd6a3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/services/broadcaster/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (t *broadcaster) runOnceIndexing(ctx context.Context) error {
})

for _, txRaw := range txs {
log := t.log.WithField("tx", txRaw.Data)
log := t.log.WithField("tx_id", txRaw.ID)

tx, err := t.genTx(ctx, 0, 0, txRaw.Data)
if err != nil {
Expand All @@ -83,10 +83,7 @@ func (t *broadcaster) runOnceIndexing(ctx context.Context) error {
gasUsed, err := t.simulateTx(ctx, tx)
if err != nil {
log.WithError(err).Error("Failed to simulate tx")

if err = t.deleteTx(ctx, log, &txRaw); err != nil {
return err
}
continue
}

gasLimit := ApproximateGasLimit(gasUsed)
Expand Down

0 comments on commit 16cd6a3

Please sign in to comment.