Skip to content

Commit a73aad6

Browse files
committed
fix validateBody
1 parent 23913cf commit a73aad6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/block_validator.go

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
7979
}
8080

8181
validateFuns := []func() error{
82+
func() error {
83+
if v.bc.HasBlockAndState(block.Hash(), block.NumberU64()) {
84+
return ErrKnownBlock
85+
}
86+
return nil
87+
},
8288
func() error {
8389
if hash := types.DeriveSha(block.Transactions(), trie.NewStackTrie(nil)); hash != header.TxHash {
8490
return fmt.Errorf("transaction root hash mismatch: have %x, want %x", hash, header.TxHash)

0 commit comments

Comments
 (0)