Skip to content

Commit 1b7db00

Browse files
committed
address comments
1 parent ed1a10a commit 1b7db00

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

core/rawdb/accessors_skipped_txs.go

+1-14
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,7 @@ func WriteSkippedTransaction(db ethdb.Database, tx *types.Transaction, traces *t
182182
}
183183

184184
func ResetSkippedTransactionTracesByHash(db ethdb.Database, txHash common.Hash) {
185-
mu.Lock()
186-
defer mu.Unlock()
187-
188-
data := readSkippedTransactionRLP(db, txHash)
189-
if len(data) == 0 {
190-
return
191-
}
192-
var stx SkippedTransaction
193-
if err := rlp.Decode(bytes.NewReader(data), &stx); err != nil {
194-
log.Crit("Invalid skipped transaction RLP", "hash", txHash.String(), "data", data, "err", err)
195-
}
196-
if stx.BlockHash != nil && *stx.BlockHash == (common.Hash{}) {
197-
stx.BlockHash = nil
198-
}
185+
stx := ReadSkippedTransaction(db, txHash)
199186
writeSkippedTransaction(db, stx.Tx, nil, stx.Reason, stx.BlockNumber, stx.BlockHash)
200187
}
201188

eth/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ func (api *ScrollAPI) GetSkippedTransactionHashes(ctx context.Context, from uint
762762
return hashes, nil
763763
}
764764

765-
// ResetSkippedTransactionsTraces reset the traces for skipped txs stored in db, and returns the list of reset transaction hashes.
765+
// ResetSkippedTransactionsTraces resets the traces for skipped txs stored in db, and returns the list of reset transaction hashes.
766766
// The skipped txs to reset are specified by the two indices provided (inclusive).
767767
func (api *ScrollAPI) ResetSkippedTransactionsTraces(ctx context.Context, from uint64, to uint64) ([]common.Hash, error) {
768768
hashes, err := api.GetSkippedTransactionHashes(ctx, from, to)

0 commit comments

Comments
 (0)