Skip to content

Commit

Permalink
fix validateBody
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Apr 20, 2022
1 parent 23913cf commit a73aad6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
}

validateFuns := []func() error{
func() error {
if v.bc.HasBlockAndState(block.Hash(), block.NumberU64()) {
return ErrKnownBlock
}
return nil
},
func() error {
if hash := types.DeriveSha(block.Transactions(), trie.NewStackTrie(nil)); hash != header.TxHash {
return fmt.Errorf("transaction root hash mismatch: have %x, want %x", hash, header.TxHash)
Expand Down

0 comments on commit a73aad6

Please sign in to comment.