diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 62518b8410..4b2c701c66 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2610,15 +2610,23 @@ UniValue debug(const UniValue& params, bool fHelp) UniValue listprojects(const UniValue& params, bool fHelp) { - if (fHelp || params.size() != 0) + if (fHelp || params.size() > 1) throw runtime_error( - "listprojects\n" + "listprojects \n" + "\n" + " -> true to show all projects, including greylisted and deleted. Defaults to false.\n" "\n" "Displays information about whitelisted projects.\n"); UniValue res(UniValue::VOBJ); - for (const auto& project : GRC::GetWhitelist().Snapshot().Sorted()) { + GRC::Project::ProjectFilterFlag filter = GRC::Project::ProjectFilterFlag::ACTIVE; + + if (params.size() && params[0].get_bool() == true) { + filter = GRC::Project::ProjectFilterFlag::ALL; + } + + for (const auto& project : GRC::GetWhitelist().Snapshot(filter).Sorted()) { UniValue entry(UniValue::VOBJ); entry.pushKV("version", (int)project.m_version); @@ -2633,6 +2641,7 @@ UniValue listprojects(const UniValue& params, bool fHelp) } entry.pushKV("time", DateTimeStrFormat(project.m_timestamp)); + entry.pushKV("status", project.StatusToString()); res.pushKV(project.m_name, entry); } diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index f99bc02991..689aa6134c 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -214,6 +214,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "getblockstats" , 2 }, { "inspectaccrualsnapshot" , 0 }, { "listmanifests" , 0 }, + { "listprojects" , 0 }, { "sendalert" , 2 }, { "sendalert" , 3 }, { "sendalert" , 4 },