diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-18 20:14:21 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-18 20:14:21 +0800 |
commit | 655e94259765b02454df93205a30a271103de5a0 (patch) | |
tree | 818cd1e9156dda16d78257b2ad656edeb0058759 /core/chain_manager.go | |
parent | be90ad89a89502ef3d2c0375d267b667618f5e7c (diff) | |
download | go-tangerine-655e94259765b02454df93205a30a271103de5a0.tar go-tangerine-655e94259765b02454df93205a30a271103de5a0.tar.gz go-tangerine-655e94259765b02454df93205a30a271103de5a0.tar.bz2 go-tangerine-655e94259765b02454df93205a30a271103de5a0.tar.lz go-tangerine-655e94259765b02454df93205a30a271103de5a0.tar.xz go-tangerine-655e94259765b02454df93205a30a271103de5a0.tar.zst go-tangerine-655e94259765b02454df93205a30a271103de5a0.zip |
Added GetBlock GetUncle with OOB guard
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r-- | core/chain_manager.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index 22d54be03..286282064 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -87,6 +87,14 @@ type ChainManager struct { transState *state.StateDB } +func NewChainManager(db ethutil.Database, mux *event.TypeMux) *ChainManager { + bc := &ChainManager{db: db, genesisBlock: GenesisBlock(db), eventMux: mux} + bc.setLastBlock() + bc.transState = bc.State().Copy() + + return bc +} + func (self *ChainManager) Td() *big.Int { self.mu.RLock() defer self.mu.RUnlock() @@ -108,14 +116,6 @@ func (self *ChainManager) CurrentBlock() *types.Block { return self.currentBlock } -func NewChainManager(db ethutil.Database, mux *event.TypeMux) *ChainManager { - bc := &ChainManager{db: db, genesisBlock: GenesisBlock(db), eventMux: mux} - bc.setLastBlock() - bc.transState = bc.State().Copy() - - return bc -} - func (self *ChainManager) Status() (td *big.Int, currentBlock []byte, genesisBlock []byte) { self.mu.RLock() defer self.mu.RUnlock() |