aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 41db117bf..f1dac2345 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -173,7 +173,7 @@ func (self *worker) pending() (*types.Block, *state.StateDB) {
self.current.receipts,
), self.current.state
}
- return self.current.Block, self.current.state
+ return self.current.Block, self.current.state.Copy()
}
func (self *worker) start() {
@@ -665,7 +665,7 @@ func (env *Work) commitTransactions(mux *event.TypeMux, transactions types.Trans
}
func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, gp *core.GasPool) (error, vm.Logs) {
- snap := env.state.Copy()
+ snap := env.state.Snapshot()
// this is a bit of a hack to force jit for the miners
config := env.config.VmConfig
@@ -676,7 +676,7 @@ func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, g
receipt, logs, _, err := core.ApplyTransaction(env.config, bc, gp, env.state, env.header, tx, env.header.GasUsed, config)
if err != nil {
- env.state.Set(snap)
+ env.state.RevertToSnapshot(snap)
return err, nil
}
env.txs = append(env.txs, tx)