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 MoonShiesty committed Aug 30, 2023
1 parent f6a856e commit 506e0dd
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 506e0dd

Please sign in to comment.