From 43af06a5fbf3808519b94db7aec1d01f2e753e94 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 22 Jul 2020 23:31:01 -0400 Subject: verify whether Block fields are in agreement with the header --- plugin/evm/vm.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugin/evm') diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go index 4b16f71..c710b9d 100644 --- a/plugin/evm/vm.go +++ b/plugin/evm/vm.go @@ -314,6 +314,9 @@ func (vm *VM) ParseBlock(b []byte) (snowman.Block, error) { if err := rlp.DecodeBytes(b, ethBlock); err != nil { return nil, err } + if !vm.chain.VerifyBlock(ethBlock) { + return nil, errInvalidBlock + } blockHash := ethBlock.Hash() // Coinbase must be zero on C-Chain if bytes.Compare(blockHash.Bytes(), vm.genesisHash.Bytes()) != 0 && -- cgit v1.2.3-70-g09d2