diff options
Diffstat (limited to 'chain/chain_manager.go')
-rw-r--r-- | chain/chain_manager.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/chain/chain_manager.go b/chain/chain_manager.go index 970fa5377..11e16fa7d 100644 --- a/chain/chain_manager.go +++ b/chain/chain_manager.go @@ -191,8 +191,8 @@ func (self *ChainManager) GetBlock(hash []byte) *types.Block { if self.workingChain != nil { // Check the temp chain for e := self.workingChain.Front(); e != nil; e = e.Next() { - if bytes.Compare(e.Value.(*link).block.Hash(), hash) == 0 { - return e.Value.(*link).block + if bytes.Compare(e.Value.(*link).Block.Hash(), hash) == 0 { + return e.Value.(*link).Block } } } @@ -275,15 +275,15 @@ func (self *ChainManager) InsertChain(chain *BlockChain, call func(*types.Block, for e := chain.Front(); e != nil; e = e.Next() { link := e.Value.(*link) - self.add(link.block) - self.SetTotalDifficulty(link.td) + self.add(link.Block) + self.SetTotalDifficulty(link.Td) - call(link.block, link.messages) + call(link.Block, link.Messages) } b, e := chain.Front(), chain.Back() if b != nil && e != nil { - front, back := b.Value.(*link).block, e.Value.(*link).block + front, back := b.Value.(*link).Block, e.Value.(*link).Block chainlogger.Infof("Imported %d blocks. #%v (%x) / %#v (%x)", chain.Len(), front.Number, front.Hash()[0:4], back.Number, back.Hash()[0:4]) } } @@ -295,7 +295,7 @@ func (self *ChainManager) TestChain(chain *BlockChain) (td *big.Int, err error) for e := chain.Front(); e != nil; e = e.Next() { var ( l = e.Value.(*link) - block = l.block + block = l.Block parent = self.GetBlock(block.PrevHash) ) @@ -314,8 +314,8 @@ func (self *ChainManager) TestChain(chain *BlockChain) (td *big.Int, err error) err = fmt.Errorf("incoming chain failed %v\n", err) return } - l.td = td - l.messages = messages + l.Td = td + l.Messages = messages } if td.Cmp(self.TD) <= 0 { @@ -329,9 +329,9 @@ func (self *ChainManager) TestChain(chain *BlockChain) (td *big.Int, err error) } type link struct { - block *types.Block - messages state.Messages - td *big.Int + Block *types.Block + Messages state.Messages + Td *big.Int } type BlockChain struct { @@ -351,7 +351,7 @@ func NewChain(blocks types.Blocks) *BlockChain { func (self *BlockChain) RlpEncode() []byte { dat := make([]interface{}, 0) for e := self.Front(); e != nil; e = e.Next() { - dat = append(dat, e.Value.(*link).block.RlpData()) + dat = append(dat, e.Value.(*link).Block.RlpData()) } return ethutil.Encode(dat) |