Skip to content

Commit

Permalink
feat: only require reindexing when the index was off going to off
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Aug 12, 2024
1 parent de4e7e1 commit c412d90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1917,19 +1917,19 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
}

// Check for changed -addressindex state
if (fAddressIndex != args.GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX)) {
if (!fAddressIndex && fAddressIndex != args.GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX)) {
strLoadError = _("You need to rebuild the database using -reindex to change -addressindex");
break;
}

// Check for changed -timestampindex state
if (fTimestampIndex != args.GetBoolArg("-timestampindex", DEFAULT_TIMESTAMPINDEX)) {
if (!fTimestampIndex && fTimestampIndex != args.GetBoolArg("-timestampindex", DEFAULT_TIMESTAMPINDEX)) {
strLoadError = _("You need to rebuild the database using -reindex to change -timestampindex");
break;
}

// Check for changed -spentindex state
if (fSpentIndex != args.GetBoolArg("-spentindex", DEFAULT_SPENTINDEX)) {
if (!fSpentIndex && fSpentIndex != args.GetBoolArg("-spentindex", DEFAULT_SPENTINDEX)) {
strLoadError = _("You need to rebuild the database using -reindex to change -spentindex");
break;
}
Expand Down

0 comments on commit c412d90

Please sign in to comment.