Fix segfault on testnet
authoralex <alex@alex-VirtualBox.(none)>
Wed, 22 Jan 2014 20:03:35 +0000 (00:03 +0400)
committeralex <alex@alex-VirtualBox.(none)>
Wed, 22 Jan 2014 20:03:35 +0000 (00:03 +0400)
src/main.cpp

index c4fead8..1c5b0da 100644 (file)
@@ -1821,7 +1821,7 @@ bool SetBestChain(CBlockIndex* pindexNew)
 
     // special case for attaching the genesis block
     // note that no ConnectBlock is called, so its coinbase output is non-spendable
-    if (pindexGenesisBlock == NULL && pindexNew->GetBlockHash() == hashGenesisBlock)
+    if (pindexGenesisBlock == NULL && pindexNew->GetBlockHash() == (!fTestNet ? hashGenesisBlock : hashGenesisBlockTestNet))
     {
         view.SetBestBlock(pindexNew);
         if (!view.Flush())