From 5ccc46fb9c989708ca9765cfb76799086ad41f71 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Wed, 27 Nov 2024 15:53:26 +0700 Subject: [PATCH] save --- turbo/jsonrpc/receipts/receipts_generator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/turbo/jsonrpc/receipts/receipts_generator.go b/turbo/jsonrpc/receipts/receipts_generator.go index 26cdc944fb6..c05e6bb6487 100644 --- a/turbo/jsonrpc/receipts/receipts_generator.go +++ b/turbo/jsonrpc/receipts/receipts_generator.go @@ -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)