From 1b178a7f966cd3649b7f0a52ffc4b8ef4c227900 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 31 Dec 2014 03:28:05 +0000 Subject: [PATCH] Bugfix: ConnectBlock: In case the genesis block gets in with fJustCheck, behave correctly --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 70e3973e6c..7c5b7401ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1616,7 +1616,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // Special case for the genesis block, skipping connection of its transactions // (its coinbase is unspendable) if (block.GetHash() == Params().HashGenesisBlock()) { - view.SetBestBlock(pindex->GetBlockHash()); + if (!fJustCheck) + view.SetBestBlock(pindex->GetBlockHash()); return true; }