diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index d9e748369..b0835cf7f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -6167,6 +6167,37 @@ UniValue listnfts(const UniValue& params, bool fHelp) return ret; } +UniValue getindexflags(const UniValue& params, bool fHelp) +{ + if (fHelp) + throw std::runtime_error( + "getindexflags\n" + "\nShows the values for index flags.\n" + + + HelpExampleCli("getindexflags", "") + ); + + UniValue ret(UniValue::VOBJ); + + // List of flags + std::string indexNames[6] = { + "addressindex", + "nameindex", + "nftindex", + "spentindex", + "timestampindex", + "txindex", + }; + + for (auto i = 0; i < 6; ++i) { + bool indexValue; + pblocktree->ReadFlag(indexNames[i], indexValue); + ret.pushKV(indexNames[i], indexValue); + } + + return ret; +} + UniValue gettoken(const UniValue& params, bool fHelp) { if (fHelp) @@ -6328,6 +6359,7 @@ static const CRPCCommand commands[] = { "wallet", "listtokens", &listtokens, true }, { "wallet", "listnfts", &listnfts, true }, { "wallet", "gettoken", &gettoken, true }, + { "wallet", "getindexflags", &getindexflags, false }, { "wallet", "getnft", &getnft, true }, { "wallet", "getbalance", &getbalance, false }, { "wallet", "getnewaddress", &getnewaddress, true },