aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-10-05 22:51:06 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-10-05 23:00:59 +0800
commit20ab29f8855982f28c6887743c737531065fa792 (patch)
tree745743d196b406563144bb62e7bb8a1cccbff092 /core/blockchain.go
parent5b34fa538e54320778314081df97da561f7c6314 (diff)
downloaddexon-20ab29f8855982f28c6887743c737531065fa792.tar
dexon-20ab29f8855982f28c6887743c737531065fa792.tar.gz
dexon-20ab29f8855982f28c6887743c737531065fa792.tar.bz2
dexon-20ab29f8855982f28c6887743c737531065fa792.tar.lz
dexon-20ab29f8855982f28c6887743c737531065fa792.tar.xz
dexon-20ab29f8855982f28c6887743c737531065fa792.tar.zst
dexon-20ab29f8855982f28c6887743c737531065fa792.zip
core: fixed head write on block insertion
Due to a rebase this probably got overlooked / ignored. This fixes the issue of a block insertion never writing the last block.
Diffstat (limited to 'core/blockchain.go')
-rw-r--r--core/blockchain.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index e8209f8e3..ad545cf69 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -297,6 +297,9 @@ func (bc *BlockChain) insert(block *types.Block) {
if err := WriteCanonicalHash(bc.chainDb, block.Hash(), block.NumberU64()); err != nil {
glog.Fatalf("failed to insert block number: %v", err)
}
+ if err := WriteHeadBlockHash(bc.chainDb, block.Hash()); err != nil {
+ glog.Fatalf("failed to insert block number: %v", err)
+ }
bc.currentBlock = block
}