aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/block.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/evm/block.go')
-rw-r--r--plugin/evm/block.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugin/evm/block.go b/plugin/evm/block.go
index ff1f6ae..1e1d710 100644
--- a/plugin/evm/block.go
+++ b/plugin/evm/block.go
@@ -89,6 +89,10 @@ func (b *Block) Verify() error {
vm := b.vm
tx := vm.getAtomicTx(b.ethBlock)
if tx != nil {
+ pState, err := b.vm.chain.BlockState(b.Parent().(*Block).ethBlock)
+ if err != nil {
+ return err
+ }
switch atx := tx.UnsignedTx.(type) {
case *UnsignedImportTx:
if b.ethBlock.Hash() == vm.genesisHash {
@@ -128,7 +132,11 @@ func (b *Block) Verify() error {
return errors.New("unknown atomic tx type")
}
- if tx.UnsignedTx.(UnsignedAtomicTx).SemanticVerify(vm, tx) != nil {
+ utx := tx.UnsignedTx.(UnsignedAtomicTx)
+ if utx.SemanticVerify(vm, tx) != nil {
+ return errInvalidBlock
+ }
+ if utx.EVMStateTransfer(vm, pState) != nil {
return errInvalidBlock
}
}