diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 468b8b04..a547a120 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -163,7 +163,8 @@ func run(ctx *cli.Context) error { vmdone := time.Since(tstart) if ctx.GlobalBool(DumpFlag.Name) { - statedb.CommitTo(db, false) + statedb.IntermediateRoot(true) + statedb.CommitTo(db, true) fmt.Println(string(statedb.Dump([]common.Address{}))) } diff --git a/core/blockchain.go b/core/blockchain.go index 456444ff..f930fb15 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -46,7 +46,7 @@ import ( "github.com/eth-classic/go-ethereum/pow" "github.com/eth-classic/go-ethereum/rlp" "github.com/eth-classic/go-ethereum/trie" - "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru" ) var ( @@ -1655,7 +1655,7 @@ func (bc *BlockChain) InsertChain(chain types.Blocks) (res *ChainInsertResult) { return } // Write state changes to database - _, err = bc.stateCache.CommitTo(bc.chainDb, false) + _, err = bc.stateCache.CommitTo(bc.chainDb, bc.config.IsAtlantis(block.Number())) if err != nil { res.Error = err return diff --git a/core/chain_manager.go b/core/chain_manager.go index 50629fa7..7cb776e0 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -234,7 +234,7 @@ func GenerateChain(config *ChainConfig, parent *types.Block, db ethdb.Database, gen(i, b) } AccumulateRewards(config, statedb, h, b.uncles) - root, err := statedb.CommitTo(db, false) + root, err := statedb.CommitTo(db, config.IsAtlantis(b.header.Number)) if err != nil { panic(fmt.Sprintf("state write error: %v", err)) } diff --git a/miner/worker.go b/miner/worker.go index d4d36085..22b2734e 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -267,7 +267,7 @@ func (self *worker) wait() { } go self.mux.Post(core.NewMinedBlockEvent{Block: block}) } else { - work.state.CommitTo(self.chainDb, false) + work.state.CommitTo(self.chainDb, work.config.IsAtlantis(block.Number())) parent := self.chain.GetBlock(block.ParentHash()) if parent == nil { glog.V(logger.Error).Infoln("Invalid block found during mining")