diff options
| author | Gavin Andresen <[email protected]> | 2013-02-05 10:15:06 -0500 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-02-05 10:15:06 -0500 |
| commit | 79892883d714dd34906a0f641400d6b237ebd75c (patch) | |
| tree | e77e54f30d6a8c5aae250f18451c1280d6b2a583 /src/init.cpp | |
| parent | Merge pull request #2273 from gavinandresen/txsize (diff) | |
| parent | Make sure the genesis block is present after reindex (diff) | |
| download | discoin-79892883d714dd34906a0f641400d6b237ebd75c.tar.xz discoin-79892883d714dd34906a0f641400d6b237ebd75c.zip | |
Merge branch 'reindexgen' of git://github.com/sipa/bitcoin
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index 2f37dad56..15a46946f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -365,6 +365,8 @@ void ThreadImport(void *data) { pblocktree->WriteReindexing(false); fReindex = false; printf("Reindexing finished\n"); + // To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked): + InitBlockIndex(); } } @@ -802,6 +804,10 @@ bool AppInit2() if (!LoadBlockIndex()) return InitError(_("Error loading block database")); + // Initialize the block index (no-op if non-empty database was already loaded) + if (!InitBlockIndex()) + return InitError(_("Error initializing block database")); + uiInterface.InitMessage(_("Verifying block database integrity...")); if (!VerifyDB()) |