Skip to content

Commit 8debb8c

Browse files
Minor fixes to get state roots to match (ethereum#146)
1 parent f8b6a24 commit 8debb8c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

core/genesis.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,12 @@ func fetchStateDump(path string, stateDump *dump.OvmDump) error {
509509
return errors.New("Unable to fetch state dump")
510510
}
511511
resp, err := http.Get(path)
512-
if resp.StatusCode >= 400 {
513-
return errors.New("State dump not found")
514-
}
515512
if err != nil {
516513
return fmt.Errorf("Unable to GET state dump: %w", err)
517514
}
515+
if resp.StatusCode >= 400 {
516+
return errors.New("State dump not found")
517+
}
518518
defer resp.Body.Close()
519519
body, err := ioutil.ReadAll(resp.Body)
520520
if err != nil {

core/vm/evm.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,9 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
581581
// Create a new account on the state
582582
snapshot := evm.StateDB.Snapshot()
583583
evm.StateDB.CreateAccount(address)
584+
if evm.chainRules.IsEIP158 {
585+
evm.StateDB.SetNonce(address, 1)
586+
}
584587
if !UsingOVM {
585588
// OVM_DISABLED
586589
evm.Transfer(evm.StateDB, caller.Address(), address, value)

0 commit comments

Comments
 (0)