From 93ecd77d776a9b275072b968a099c5b88bbac8e6 Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Thu, 15 Jun 2023 07:52:06 -0400 Subject: [PATCH] core: remove unnecessary log copy (#27475) The logs in this function are pulled straight from disk in rawdb.ReadRawReceipts and also modified in receipts.DeriveFields, so removing the copy should be fine. --- core/blockchain.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index c9b80bc2ff..ec8b789c58 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2053,11 +2053,10 @@ func (bc *BlockChain) collectLogs(b *types.Block, removed bool) []*types.Log { var logs []*types.Log for _, receipt := range receipts { for _, log := range receipt.Logs { - l := *log if removed { - l.Removed = true + log.Removed = true } - logs = append(logs, &l) + logs = append(logs, log) } } return logs