core: remove unnecessary log copy (#27475)

This commit is contained in:
Daniel Liu 2024-12-25 11:33:56 +08:00
parent d03859d49e
commit c8c39efb63

View file

@ -2263,9 +2263,10 @@ func (bc *BlockChain) collectLogs(b *types.Block, removed bool) []*types.Log {
var logs []*types.Log var logs []*types.Log
for _, receipt := range receipts { for _, receipt := range receipts {
for _, log := range receipt.Logs { for _, log := range receipt.Logs {
l := *log if removed {
l.Removed = removed log.Removed = true
logs = append(logs, &l) }
logs = append(logs, log)
} }
} }
return logs return logs