From 865a89b93373f5d17fa66b876a33bc1e05daf16e Mon Sep 17 00:00:00 2001 From: qiwei9743 Date: Wed, 26 Sep 2018 14:52:53 +0800 Subject: [PATCH] workaround @ConnectBlock issue. --- logic/lchain/lchain.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logic/lchain/lchain.go b/logic/lchain/lchain.go index ac2f8336..2b94010b 100644 --- a/logic/lchain/lchain.go +++ b/logic/lchain/lchain.go @@ -53,7 +53,11 @@ func ConnectBlock(pblock *block.Block, pindex *blockindex.BlockIndex, view *utxo if pindex.Prev == nil { hashPrevBlock = &util.Hash{} } else { - hashPrevBlock = pindex.GetBlockHash() + if fJustCheck { + hashPrevBlock = pindex.GetBlockHash() + } else { + hashPrevBlock = pindex.Prev.GetBlockHash() + } } gUtxo := utxo.GetUtxoCacheInstance() bestHash, _ := gUtxo.GetBestBlock()