aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-01-31 18:46:38 +0800
committerGitHub <noreply@github.com>2018-01-31 18:46:38 +0800
commitfdb34b7a7c87142cde48a2ec092f77a56d66f773 (patch)
tree6608a33f95d5067d23f01c6951eca3f983c3566d /core
parent07d4a022573444eac0db2f5da500cc5ee1e940bb (diff)
parent566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2 (diff)
downloaddexon-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar
dexon-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.gz
dexon-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.bz2
dexon-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.lz
dexon-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.xz
dexon-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.zst
dexon-fdb34b7a7c87142cde48a2ec092f77a56d66f773.zip
Merge pull request #15996 from karalabe/drop-redundant-methods
core, eth, les, light: get rid of redundant methods
Diffstat (limited to 'core')
-rw-r--r--core/blockchain.go19
1 files changed, 1 insertions, 18 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index 1bda95231..d5e139e31 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -312,14 +312,6 @@ func (bc *BlockChain) GasLimit() uint64 {
return bc.currentBlock.GasLimit()
}
-// LastBlockHash return the hash of the HEAD block.
-func (bc *BlockChain) LastBlockHash() common.Hash {
- bc.mu.RLock()
- defer bc.mu.RUnlock()
-
- return bc.currentBlock.Hash()
-}
-
// CurrentBlock retrieves the current head block of the canonical chain. The
// block is retrieved from the blockchain's internal cache.
func (bc *BlockChain) CurrentBlock() *types.Block {
@@ -338,15 +330,6 @@ func (bc *BlockChain) CurrentFastBlock() *types.Block {
return bc.currentFastBlock
}
-// Status returns status information about the current chain such as the HEAD Td,
-// the HEAD hash and the hash of the genesis block.
-func (bc *BlockChain) Status() (td *big.Int, currentBlock common.Hash, genesisBlock common.Hash) {
- bc.mu.RLock()
- defer bc.mu.RUnlock()
-
- return bc.GetTd(bc.currentBlock.Hash(), bc.currentBlock.NumberU64()), bc.currentBlock.Hash(), bc.genesisBlock.Hash()
-}
-
// SetProcessor sets the processor required for making state modifications.
func (bc *BlockChain) SetProcessor(processor Processor) {
bc.procmu.Lock()
@@ -1006,7 +989,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
stats.report(chain, i)
}
// Append a single chain head event if we've progressed the chain
- if lastCanon != nil && bc.LastBlockHash() == lastCanon.Hash() {
+ if lastCanon != nil && bc.CurrentBlock().Hash() == lastCanon.Hash() {
events = append(events, ChainHeadEvent{lastCanon})
}
return 0, events, coalescedLogs, nil