File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,28 @@ class GetinfoRequestHandler: public BaseRequestHandler
286286 }
287287};
288288
289+ /* * Process RPC generatetoaddress request. */
290+ class GenerateToAddressRequestHandler : public BaseRequestHandler
291+ {
292+ public:
293+ UniValue PrepareRequest (const std::string& method, const std::vector<std::string>& args) override
294+ {
295+ address_str = args.at (1 );
296+ UniValue params{RPCConvertValues (" generatetoaddress" , args)};
297+ return JSONRPCRequestObj (" generatetoaddress" , params, 1 );
298+ }
299+
300+ UniValue ProcessReply (const UniValue &reply) override
301+ {
302+ UniValue result (UniValue::VOBJ);
303+ result.pushKV (" address" , address_str);
304+ result.pushKV (" blocks" , reply.get_obj ()[" result" ]);
305+ return JSONRPCReplyObj (result, NullUniValue, 1 );
306+ }
307+ protected:
308+ std::string address_str;
309+ };
310+
289311/* * Process default single requests */
290312class DefaultRequestHandler : public BaseRequestHandler {
291313public:
You can’t perform that action at this time.
0 commit comments