Skip to content

Commit

Permalink
core: remove unnecessary log copy (ethereum#27475)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aaronbuchwald authored and devopsbo3 committed Nov 10, 2023
1 parent 797f6d0 commit 44a8cec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 44a8cec

Please sign in to comment.