Skip to content

Commit

Permalink
Added new -nftindex param
Browse files Browse the repository at this point in the history
  • Loading branch information
mxaddict committed Feb 21, 2022
1 parent 024f97c commit 9944d99
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ std::string HelpMessage(HelpMessageMode mode)
#endif
strUsage += HelpMessageOpt("-allindex", strprintf(_("Maintain all indexes supported (default: %u)"), false));
strUsage += HelpMessageOpt("-txindex", strprintf(_("Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)"), DEFAULT_TXINDEX));
strUsage += HelpMessageOpt("-nftindex", strprintf(_("Maintain an index of ntf data, used by the nft related rpc calls (default: %u)"), DEFAULT_NFTINDEX));

strUsage += HelpMessageOpt("-addressindex", strprintf(_("Maintain a full address index, used to query for the balance, txids and unspent outputs for addresses (default: %u)"), DEFAULT_ADDRESSINDEX));
strUsage += HelpMessageOpt("-timestampindex", strprintf(_("Maintain a timestamp index for block hashes, used to query blocks hashes by a range of timestamps (default: %u)"), DEFAULT_TIMESTAMPINDEX));
Expand Down Expand Up @@ -1629,6 +1630,12 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler, const std
break;
}

// Check for changed -nftindex state
if (fNftIndex != GetBoolArg("-nftindex", DEFAULT_NFTINDEX)) {
strLoadError = _("You need to rebuild the database using -reindex-chainstate to change -nftindex");
break;
}

// Check for changed -addressindex state
if (fAddressIndex != GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX)) {
strLoadError = _("You need to rebuild the database using -reindex-chainstate to change -addressindex");
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7721,6 +7721,7 @@ bool InitBlockIndex(const CChainParams& chainparams)

// Load the flag values | use DEFAULT_* values if not set
fTxIndex = GetBoolArg("-txindex", DEFAULT_TXINDEX);
fNftIndex = GetBoolArg("-nftindex", DEFAULT_NFTINDEX);
fAddressIndex = GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX);
fTimestampIndex = GetBoolArg("-timestampindex", DEFAULT_TIMESTAMPINDEX);
fSpentIndex = GetBoolArg("-spentindex", DEFAULT_SPENTINDEX);
Expand Down
1 change: 1 addition & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60;
static const bool DEFAULT_PERMIT_BAREMULTISIG = true;
static const bool DEFAULT_CHECKPOINTS_ENABLED = true;
static const bool DEFAULT_TXINDEX = false;
static const bool DEFAULT_NFTINDEX = false;
static const bool DEFAULT_ADDRESSINDEX = false;
static const bool DEFAULT_TIMESTAMPINDEX = false;
static const bool DEFAULT_SPENTINDEX = false;
Expand Down

0 comments on commit 9944d99

Please sign in to comment.