From 20f10ca95a9adc70d17cdc6bef806b79616c8e16 Mon Sep 17 00:00:00 2001 From: Enrique Avila Asapche Date: Thu, 9 Sep 2021 18:58:34 +0300 Subject: [PATCH] Added identifier instead of kv.Receipts --- eth/stagedsync/stage_execute.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eth/stagedsync/stage_execute.go b/eth/stagedsync/stage_execute.go index 5344f5721..077d64ba0 100644 --- a/eth/stagedsync/stage_execute.go +++ b/eth/stagedsync/stage_execute.go @@ -612,7 +612,7 @@ func PruneExecutionStage(s *PruneState, tx kv.RwTx, cfg ExecuteBlockCfg, ctx con } if cfg.prune.Receipts.Enabled() { - if err = pruneReceipts(tx, logPrefix, cfg.prune.Receipts.PruneTo(s.ForwardProgress), logEvery, ctx); err != nil { + if err = pruneReceipts(tx, kv.Receipts, logPrefix, cfg.prune.Receipts.PruneTo(s.ForwardProgress), logEvery, ctx); err != nil { return err } } @@ -633,8 +633,10 @@ func PruneExecutionStage(s *PruneState, tx kv.RwTx, cfg ExecuteBlockCfg, ctx con return nil } -func pruneReceipts(tx kv.RwTx, logPrefix string, pruneTo uint64, logEvery *time.Ticker, ctx context.Context) error { - c, err := tx.RwCursor(kv.Receipts) +func pruneReceipts(tx kv.RwTx, table string, logPrefix string, pruneTo uint64, logEvery *time.Ticker, ctx context.Context) error { + c, err := tx.RwCursor(table) + fmt.Println(kv.Receipts) + if err != nil { return fmt.Errorf("failed to create cursor for pruning %w", err) } @@ -651,7 +653,7 @@ func pruneReceipts(tx kv.RwTx, logPrefix string, pruneTo uint64, logEvery *time. } select { case <-logEvery.C: - log.Info(fmt.Sprintf("[%s]", logPrefix), "table", kv.Receipts, "block", blockNum) + log.Info(fmt.Sprintf("[%s]", logPrefix), "table", table, "block", blockNum) case <-ctx.Done(): return common.ErrStopped default: