mirror of
https://github.com/status-im/op-geth.git
synced 2025-01-15 17:24:36 +00:00
add Status to retrieve TD, currentBlock, genesis for easy interface with eth/protocol
This commit is contained in:
parent
39d86a28e7
commit
d84810d89d
@ -72,6 +72,10 @@ func NewChainManager(mux *event.TypeMux) *ChainManager {
|
|||||||
return bc
|
return bc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *ChainManager) Status() (td *big.Int, currentBlock []byte, genesisBlock []byte) {
|
||||||
|
return self.TD, self.CurrentBlock.Hash(), self.Genesis().Hash()
|
||||||
|
}
|
||||||
|
|
||||||
func (self *ChainManager) SetProcessor(proc types.BlockProcessor) {
|
func (self *ChainManager) SetProcessor(proc types.BlockProcessor) {
|
||||||
self.processor = proc
|
self.processor = proc
|
||||||
}
|
}
|
||||||
@ -173,7 +177,7 @@ func (bc *ChainManager) HasBlock(hash []byte) bool {
|
|||||||
return len(data) != 0
|
return len(data) != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *ChainManager) GetChainHashesFromHash(hash []byte, max uint64) (chain [][]byte) {
|
func (self *ChainManager) GetBlockHashesFromHash(hash []byte, max uint64) (chain [][]byte) {
|
||||||
block := self.GetBlock(hash)
|
block := self.GetBlock(hash)
|
||||||
if block == nil {
|
if block == nil {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user