aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-21 17:42:31 +0800
committerobscuren <geffobscura@gmail.com>2014-05-21 17:42:31 +0800
commit07fe00c4661e3b96e1758598df881057c1f52b3a (patch)
treeebce52a3e49a2eaf6009e0da6fdaa3de80a15174 /ethchain
parentcbf221f6b7a48ece543d6141d8a7e9dbf9b8d86d (diff)
downloaddexon-07fe00c4661e3b96e1758598df881057c1f52b3a.tar.gz
dexon-07fe00c4661e3b96e1758598df881057c1f52b3a.tar.zst
dexon-07fe00c4661e3b96e1758598df881057c1f52b3a.zip
Changed numbers
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/block_chain.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/ethchain/block_chain.go b/ethchain/block_chain.go
index 2865336fb..b72c78cdb 100644
--- a/ethchain/block_chain.go
+++ b/ethchain/block_chain.go
@@ -190,8 +190,8 @@ func (bc *BlockChain) ResetTillBlockHash(hash []byte) error {
returnTo = bc.GetBlock(hash)
bc.CurrentBlock = returnTo
bc.LastBlockHash = returnTo.Hash()
- info := bc.BlockInfo(returnTo)
- bc.LastBlockNumber = info.Number
+ //info := bc.BlockInfo(returnTo)
+ bc.LastBlockNumber = returnTo.Number.Uint64()
}
// XXX Why are we resetting? This is the block chain, it has nothing to do with states
@@ -228,9 +228,9 @@ func (bc *BlockChain) GetChainFromHash(hash []byte, max uint64) []interface{} {
// Get the current hash to start with
currentHash := bc.CurrentBlock.Hash()
// Get the last number on the block chain
- lastNumber := bc.BlockInfo(bc.CurrentBlock).Number
+ lastNumber := bc.CurrentBlock.Number.Uint64()
// Get the parents number
- parentNumber := bc.BlockInfoByHash(hash).Number
+ parentNumber := bc.GetBlock(hash).Number.Uint64()
// Get the min amount. We might not have max amount of blocks
count := uint64(math.Min(float64(lastNumber-parentNumber), float64(max)))
startNumber := parentNumber + count
@@ -291,10 +291,10 @@ func (bc *BlockChain) setLastBlock() {
data, _ := ethutil.Config.Db.Get([]byte("LastBlock"))
if len(data) != 0 {
block := NewBlockFromBytes(data)
- info := bc.BlockInfo(block)
+ //info := bc.BlockInfo(block)
bc.CurrentBlock = block
bc.LastBlockHash = block.Hash()
- bc.LastBlockNumber = info.Number
+ bc.LastBlockNumber = block.Number.Uint64()
ethutil.Config.Log.Infof("[CHAIN] Last known block height #%d\n", bc.LastBlockNumber)
} else {