diff --git a/src/main.cpp b/src/main.cpp index 26adbf71780..e740d8e3198 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3032,7 +3032,7 @@ public: CBlock* CreateNewBlock(CReserveKey& reservekey) { - CBlockIndex* pindexPrev = pindexBest; + CBlockIndex* pindexPrev; // Create new block auto_ptr pblock(new CBlock()); @@ -3054,6 +3054,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) CRITICAL_BLOCK(cs_main) CRITICAL_BLOCK(cs_mapTransactions) { + pindexPrev = pindexBest; CTxDB txdb("r"); // Priority order to process transactions