This commit is contained in:
jl777
2018-08-21 07:31:40 -11:00
parent f0731bd796
commit dcf05e8490

View File

@@ -5319,11 +5319,27 @@ bool InitBlockIndex() {
// Initialize global variables that cannot be constructed at startup.
recentRejects.reset(new CRollingBloomFilter(120000, 0.000001));
fprintf(stderr,"InitBlockIndex called\n");
// Check whether we're already initialized
if (chainActive.Genesis() != NULL)
{
bool checkval;
fAddressIndex = GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX);
pblocktree->ReadFlag("addressindex", checkval);
if ( checkval != fAddressIndex )
{
pblocktree->WriteFlag("addressindex", fAddressIndex);
fprintf(stderr,"set addressindex\n");
}
fSpentIndex = GetBoolArg("-spentindex", DEFAULT_SPENTINDEX);
pblocktree->ReadFlag("spentindex", checkval);
if ( checkval != fSpentIndex )
{
pblocktree->WriteFlag("spentindex", fSpentIndex);
fprintf(stderr,"set spentindex\n");
}
return true;
}
// Use the provided setting for -txindex in the new database
fTxIndex = GetBoolArg("-txindex", true);
pblocktree->WriteFlag("txindex", fTxIndex);