Skip to content

Commit

Permalink
core: remove unnecessary log copy (#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 committed Jun 15, 2023
1 parent 7823ff6 commit 93ecd77
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 93ecd77

Please sign in to comment.