Skip to content

Commit

Permalink
fix: apply comment
Browse files Browse the repository at this point in the history
  • Loading branch information
egonspace committed May 20, 2024
1 parent 6387431 commit 393fc74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package core

import (
"bytes"
"fmt"
"math/big"

Expand Down Expand Up @@ -92,8 +91,8 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
err := p.engine.Finalize(p.bc, header, statedb, block.Transactions(), block.Uncles())
header.Fees = fees

if !bytes.Equal(block.Header().Hash().Bytes(), header.Hash().Bytes()) {
return nil, nil, 0, fmt.Errorf("Remote block hash is different from being processed one locally (remote=%v, local=%v)", block.Header().Hash(), header.Hash())
if block.Header().Hash() != header.Hash() {
return nil, nil, 0, fmt.Errorf("remote block hash is different from being processed one locally (remote=%v, local=%v)", block.Header().Hash(), header.Hash())
}

return receipts, allLogs, *usedGas, err
Expand Down
3 changes: 3 additions & 0 deletions core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ func CopyHeader(h *Header) *Header {
cpy.Rewards = make([]byte, len(h.Rewards))
copy(cpy.Rewards, h.Rewards)
}
if h.Fees != nil {
cpy.Fees = new(big.Int).Set(h.Fees)
}
return &cpy
}

Expand Down

0 comments on commit 393fc74

Please sign in to comment.