Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Nov 27, 2024
1 parent 8a842e2 commit 5ccc46f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions turbo/jsonrpc/receipts/receipts_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func (g *Generator) PrepareEnv(ctx context.Context, block *types.Block, cfg *cha
}

func (g *Generator) GetReceipt(ctx context.Context, cfg *chain.Config, tx kv.Tx, block *types.Block, index int, optimize bool) (*types.Receipt, error) {
if receipts, ok := g.receiptsCache.Get(block.Hash()); ok && len(receipts) > index {
return receipts[index], nil
}

var receipt *types.Receipt
if optimize {
genEnv, err := g.PrepareEnv(ctx, block, cfg, tx, index)
Expand Down

0 comments on commit 5ccc46f

Please sign in to comment.