Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #586 from ethereumproject/fix/svm-processor-blockh…
Browse files Browse the repository at this point in the history
…ash-nil-pointer

multivm/sputnikvm.RequireBlockhash: ensure block exists in db
  • Loading branch information
whilei authored May 10, 2018
2 parents bc66999 + d04d8c1 commit 55fb00b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/multivm_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,17 @@ Loop:
key := common.BigToHash(ret.StorageKey())
if statedb.Exist(address) {
value := statedb.GetState(address, key).Big()
key := ret.StorageKey()
vm.CommitAccountStorage(address, key, value)
sKey := ret.StorageKey()
vm.CommitAccountStorage(address, sKey, value)
break
}
vm.CommitNonexist(address)
case sputnikvm.RequireBlockhash:
number := ret.BlockNumber()
hash := bc.GetBlockByNumber(number.Uint64()).Hash()
hash := common.Hash{}
if block := bc.GetBlockByNumber(number.Uint64()); block != nil && block.Number().Cmp(number) == 0 {
hash = block.Hash()
}
vm.CommitBlockhash(number, hash)
}
}
Expand Down

0 comments on commit 55fb00b

Please sign in to comment.