Skip to content

Commit

Permalink
add automatic reindexing for 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgenijM86 committed Mar 27, 2017
1 parent 3f7373d commit 8e2a50f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ bool AppInit2(boost::thread_group& threadGroup)

if (!LoadBlockIndex()) {
bool fAuxPow;
if (fAuxReindex == 0 && (!pblocktree->ReadFlag("auxpow", fAuxPow) || !fAuxPow))
if (fAuxReindex == 0 && (!pblocktree->ReadFlag("auxpow2", fAuxPow) || !fAuxPow))
{
strLoadError = _("No auxpow support found, trying to reindex blockindex...");
fAuxReindex++;
Expand Down Expand Up @@ -1117,7 +1117,7 @@ bool AppInit2(boost::thread_group& threadGroup)
if (!fReset) {
// emercoin: try to reindex if no auxpow flag
bool fAuxPow;
if (fAuxReindex == 1 && (!pblocktree->ReadFlag("auxpow", fAuxPow) || !fAuxPow))
if (fAuxReindex == 1 && (!pblocktree->ReadFlag("auxpow2", fAuxPow) || !fAuxPow))
{
fReindex = true;
fRequestShutdown = false;
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3592,7 +3592,7 @@ bool LoadBlockIndex()
if (pblocktree->ReadFlag("txindex", txindex))
{
bool fAuxPow;
if (!fReindex && (!pblocktree->ReadFlag("auxpow", fAuxPow) || !fAuxPow)) {
if (!fReindex && (!pblocktree->ReadFlag("auxpow2", fAuxPow) || !fAuxPow)) {
return false;
}
}
Expand All @@ -3614,7 +3614,7 @@ bool InitBlockIndex() {
//fTxIndex = GetBoolArg("-txindex", false);
fTxIndex = true; // ppcoin: txindex is always enabled
pblocktree->WriteFlag("txindex", fTxIndex);
pblocktree->WriteFlag("auxpow", true);
pblocktree->WriteFlag("auxpow2", true);
LogPrintf("Initializing databases...\n");

// Only add the genesis block if not reindexing (in which case we reuse the one already on disk)
Expand Down

0 comments on commit 8e2a50f

Please sign in to comment.