aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-04-24 02:46:27 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-04-24 02:46:27 +0800
commitf5e0388f62085c7eb100769765f8649ec364c1bd (patch)
tree5a40c627855698b6d5a912c84ab8008fdc24da44 /core
parentabe08d7be34d5d3278f8473bdbd5a94756f8cfd3 (diff)
parentc12180d00566dba977b2d34f61ed52e2a4d279ed (diff)
downloaddexon-f5e0388f62085c7eb100769765f8649ec364c1bd.tar
dexon-f5e0388f62085c7eb100769765f8649ec364c1bd.tar.gz
dexon-f5e0388f62085c7eb100769765f8649ec364c1bd.tar.bz2
dexon-f5e0388f62085c7eb100769765f8649ec364c1bd.tar.lz
dexon-f5e0388f62085c7eb100769765f8649ec364c1bd.tar.xz
dexon-f5e0388f62085c7eb100769765f8649ec364c1bd.tar.zst
dexon-f5e0388f62085c7eb100769765f8649ec364c1bd.zip
Merge pull request #778 from bas-vk/issue764
Moved database update loop to eth/backend
Diffstat (limited to 'core')
-rw-r--r--core/chain_manager.go10
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) {