From c8c39efb630a9b4c573722b7101f97268e4a4b29 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Wed, 25 Dec 2024 11:33:56 +0800 Subject: [PATCH] core: remove unnecessary log copy (#27475) --- core/blockchain.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 9fd7582960a8..66b6fdcddc67 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2263,9 +2263,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 - l.Removed = removed - logs = append(logs, &l) + if removed { + log.Removed = true + } + logs = append(logs, log) } } return logs