aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-12-15 03:30:32 +0800
committerzelig <viktor.tron@gmail.com>2014-12-15 04:45:12 +0800
commit7b39cc83cc5dcbcab6b2c35b81ea593628bbdb1f (patch)
treef2585b62c7dce7d56eb749b842f72b599cfabf34
parent01dc1c13942867d0579f5010a560da4073ece05e (diff)
downloadgo-tangerine-7b39cc83cc5dcbcab6b2c35b81ea593628bbdb1f.tar.gz
go-tangerine-7b39cc83cc5dcbcab6b2c35b81ea593628bbdb1f.tar.zst
go-tangerine-7b39cc83cc5dcbcab6b2c35b81ea593628bbdb1f.zip
adapt chain_manager to eth protocol interface
- add Status() to return td, currentblock hash, genesis hash - GetChainHashesFromHash -> GetBlockHashesFromHash
-rw-r--r--core/chain_manager.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index f9fb3b3f8..9ed2c1c42 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -137,6 +137,10 @@ func (bc *ChainManager) NewBlock(coinbase []byte) *types.Block {
return block
}
+func (self *ChainManager) Status() (td *big.Int, currentBlock []byte, genesisBlock []byte) {
+ return self.TD, self.CurrentBlock.Hash(), self.Genesis().Hash()
+}
+
func (bc *ChainManager) Reset() {
AddTestNetFunds(bc.genesisBlock)