diff options
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r-- | core/chain_manager.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index 47f84b80a..a09b2e63b 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -342,14 +342,14 @@ func (self *ChainManager) Export(w io.Writer) error { } func (bc *ChainManager) insert(block *types.Block) { - bc.blockDb.Put([]byte("LastBlock"), block.Hash().Bytes()) - bc.currentBlock = block - bc.lastBlockHash = block.Hash() - key := append(blockNumPre, block.Number().Bytes()...) - bc.blockDb.Put(key, bc.lastBlockHash.Bytes()) + bc.blockDb.Put(key, block.Hash().Bytes()) // Push block to cache bc.cache.Push(block) + + bc.blockDb.Put([]byte("LastBlock"), block.Hash().Bytes()) + bc.currentBlock = block + bc.lastBlockHash = block.Hash() } func (bc *ChainManager) write(block *types.Block) { |