aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-04-17 11:41:10 -0400
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-26 10:46:51 -0700
commitd6af06d68aae985436cbc942f0d11078041d121b (patch)
treea8af3452e747b038bc50957aae8b47a9e8585ee5 /src/validation.cpp
parenteaca1b7b08b4911292d49efbce8471cbc9ca0e1c (diff)
Dont create pcoinsTip until after ReplayBlocks.
This requires that we not access pcoinsTip in InitBlockIndex's FlushStateToDisk (so we just skip it until later in AppInitMain) and the LoadChainTip in LoadBlockIndex (which there is already one later in AppinitMain, after ReplayBlocks, so skipping it there is fine). Includes some simplifications by Suhas Daftuar and Pieter Wuille.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 77b96be1e5..6100ccb33d 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3420,7 +3420,6 @@ bool static LoadBlockIndexDB(const CChainParams& chainparams)
pblocktree->ReadFlag("txindex", fTxIndex);
LogPrintf("%s: transaction index %s\n", __func__, fTxIndex ? "enabled" : "disabled");
- LoadChainTip(chainparams);
return true;
}
@@ -3783,8 +3782,6 @@ bool InitBlockIndex(const CChainParams& chainparams)
CBlockIndex *pindex = AddToBlockIndex(block);
if (!ReceivedBlockTransactions(block, state, pindex, blockPos, chainparams.GetConsensus()))
return error("LoadBlockIndex(): genesis block not accepted");
- // Force a chainstate write so that when we VerifyDB in a moment, it doesn't check stale data
- return FlushStateToDisk(chainparams, state, FLUSH_STATE_ALWAYS);
} catch (const std::runtime_error& e) {
return error("LoadBlockIndex(): failed to initialize block database: %s", e.what());
}