core, eth, les, light: get rid of redundant methods

This commit is contained in:
Péter Szilágyi
2018-01-30 18:39:32 +02:00
parent 6198c53e28
commit 566d5c0777
10 changed files with 54 additions and 65 deletions

View File

@ -176,25 +176,6 @@ func (self *LightChain) GasLimit() uint64 {
return self.hc.CurrentHeader().GasLimit
}
// LastBlockHash return the hash of the HEAD block.
func (self *LightChain) LastBlockHash() common.Hash {
self.mu.RLock()
defer self.mu.RUnlock()
return self.hc.CurrentHeader().Hash()
}
// Status returns status information about the current chain such as the HEAD Td,
// the HEAD hash and the hash of the genesis block.
func (self *LightChain) Status() (td *big.Int, currentBlock common.Hash, genesisBlock common.Hash) {
self.mu.RLock()
defer self.mu.RUnlock()
header := self.hc.CurrentHeader()
hash := header.Hash()
return self.GetTd(hash, header.Number.Uint64()), hash, self.genesisBlock.Hash()
}
// Reset purges the entire blockchain, restoring it to its genesis state.
func (bc *LightChain) Reset() {
bc.ResetWithGenesisBlock(bc.genesisBlock)
@ -337,7 +318,7 @@ func (self *LightChain) postChainEvents(events []interface{}) {
for _, event := range events {
switch ev := event.(type) {
case core.ChainEvent:
if self.LastBlockHash() == ev.Hash {
if self.CurrentHeader().Hash() == ev.Hash {
self.chainHeadFeed.Send(core.ChainHeadEvent{Block: ev.Block})
}
self.chainFeed.Send(ev)