diff options
| author | Matt Corallo <[email protected]> | 2017-04-17 11:41:10 -0400 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-06-26 10:46:51 -0700 |
| commit | d6af06d68aae985436cbc942f0d11078041d121b (patch) | |
| tree | a8af3452e747b038bc50957aae8b47a9e8585ee5 /src/init.cpp | |
| parent | Random db flush crash simulator (diff) | |
| download | discoin-d6af06d68aae985436cbc942f0d11078041d121b.tar.xz discoin-d6af06d68aae985436cbc942f0d11078041d121b.zip | |
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/init.cpp')
| -rw-r--r-- | src/init.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp index 51f0d4003..794c6bc45 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1385,7 +1385,6 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex); pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex || fReindexChainState); pcoinscatcher = new CCoinsViewErrorCatcher(pcoinsdbview); - pcoinsTip = new CCoinsViewCache(pcoinscatcher); if (fReindex) { pblocktree->WriteReindexing(true); @@ -1433,7 +1432,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) strLoadError = _("Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate."); break; } - pcoinsTip->SetBestBlock(pcoinsdbview->GetBestBlock()); // TODO: only initialize pcoinsTip after ReplayBlocks + pcoinsTip = new CCoinsViewCache(pcoinscatcher); LoadChainTip(chainparams); if (!fReindex && chainActive.Tip() != NULL) { |