diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-11 02:59:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-11 02:59:12 +0800 |
commit | 5553e5aaed5c3f4e303b7d6671d2c92a45aa487e (patch) | |
tree | fc4f9c7a088d0af0e3eec76258df89c3e9968ba4 /core/chain_manager.go | |
parent | af6afbaa56efa15abe6a03665c6674b0e2f591c8 (diff) | |
download | dexon-5553e5aaed5c3f4e303b7d6671d2c92a45aa487e.tar.gz dexon-5553e5aaed5c3f4e303b7d6671d2c92a45aa487e.tar.zst dexon-5553e5aaed5c3f4e303b7d6671d2c92a45aa487e.zip |
states moved to chain
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r-- | core/chain_manager.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index 150139def..0322edaa5 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/state" ) var chainlogger = logger.NewLogger("CHAIN") @@ -55,6 +56,8 @@ type ChainManager struct { CurrentBlock *types.Block LastBlockHash []byte + + transState *state.StateDB } func NewChainManager(mux *event.TypeMux) *ChainManager { @@ -64,6 +67,8 @@ func NewChainManager(mux *event.TypeMux) *ChainManager { bc.setLastBlock() + bc.transState = bc.State().Copy() + return bc } @@ -71,6 +76,14 @@ func (self *ChainManager) SetProcessor(proc types.BlockProcessor) { self.processor = proc } +func (self *ChainManager) State() *state.StateDB { + return self.CurrentBlock.State() +} + +func (self *ChainManager) TransState() *state.StateDB { + return self.transState +} + func (bc *ChainManager) setLastBlock() { data, _ := ethutil.Config.Db.Get([]byte("LastBlock")) if len(data) != 0 { |