Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 },
Expand Down