Changeset View
Changeset View
Standalone View
Standalone View
src/zmq/zmqrpc.cpp
Show All 10 Lines | |||||
#include <univalue.h> | #include <univalue.h> | ||||
namespace { | namespace { | ||||
UniValue getzmqnotifications(const Config &config, | UniValue getzmqnotifications(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error( | ||||
"getzmqnotifications", | "getzmqnotifications\n" | ||||
"\nReturns information about the active ZeroMQ " | "\nReturns information about the active ZeroMQ notifications.\n" | ||||
"notifications.\n", | "\nResult:\n" | ||||
{}, | |||||
RPCResult{ | |||||
"[\n" | "[\n" | ||||
" { (json object)\n" | " { (json object)\n" | ||||
" \"type\": \"pubhashtx\", (string) Type of notification\n" | " \"type\": \"pubhashtx\", (string) Type of notification\n" | ||||
" \"address\": \"...\" (string) Address of the " | " \"address\": \"...\", (string) Address of the publisher\n" | ||||
"publisher\n" | " \"hwm\": n (numeric) Outbound message high " | ||||
"water mark\n" | |||||
" },\n" | " },\n" | ||||
" ...\n" | " ...\n" | ||||
"]\n"}, | "]\n" | ||||
RPCExamples{HelpExampleCli("getzmqnotifications", "") + | "\nExamples:\n" + | ||||
HelpExampleRpc("getzmqnotifications", "")}, | HelpExampleCli("getzmqnotifications", "") + | ||||
} | HelpExampleRpc("getzmqnotifications", "")); | ||||
Fabien: No, you removed RPCHelpMan | |||||
.ToString()); | |||||
} | } | ||||
UniValue result(UniValue::VARR); | UniValue result(UniValue::VARR); | ||||
if (g_zmq_notification_interface != nullptr) { | if (g_zmq_notification_interface != nullptr) { | ||||
for (const auto *n : | for (const auto *n : | ||||
g_zmq_notification_interface->GetActiveNotifiers()) { | g_zmq_notification_interface->GetActiveNotifiers()) { | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
obj.pushKV("type", n->GetType()); | obj.pushKV("type", n->GetType()); | ||||
obj.pushKV("address", n->GetAddress()); | obj.pushKV("address", n->GetAddress()); | ||||
obj.pushKV("hwm", n->GetOutboundMessageHighWaterMark()); | |||||
result.push_back(obj); | result.push_back(obj); | ||||
} | } | ||||
} | } | ||||
return result; | return result; | ||||
} | } | ||||
// clang-format off | // clang-format off | ||||
Show All 14 Lines |
No, you removed RPCHelpMan