@@ -130,14 +130,10 @@ static void libevent_log_cb(int severity, const char *msg)
130
130
// Exception thrown on connection error. This error is used to determine
131
131
// when to wait if -rpcwait is given.
132
132
//
133
- class CConnectionFailed : public std ::runtime_error
134
- {
135
- public:
136
-
133
+ struct CConnectionFailed : std::runtime_error {
137
134
explicit inline CConnectionFailed (const std::string& msg) :
138
135
std::runtime_error(msg)
139
136
{}
140
-
141
137
};
142
138
143
139
//
@@ -267,21 +263,17 @@ static int8_t NetworkStringToId(const std::string& str)
267
263
return UNKNOWN_NETWORK;
268
264
}
269
265
270
- /* * Class that handles the conversion from a command-line to a JSON-RPC request,
266
+ /* * Handle the conversion from a command-line to a JSON-RPC request,
271
267
* as well as converting back to a JSON object that can be shown as result.
272
268
*/
273
- class BaseRequestHandler
274
- {
275
- public:
269
+ struct BaseRequestHandler {
276
270
virtual ~BaseRequestHandler () = default ;
277
271
virtual UniValue PrepareRequest (const std::string& method, const std::vector<std::string>& args) = 0;
278
272
virtual UniValue ProcessReply (const UniValue &batch_in) = 0;
279
273
};
280
274
281
275
/* * Process addrinfo requests */
282
- class AddrinfoRequestHandler : public BaseRequestHandler
283
- {
284
- public:
276
+ struct AddrinfoRequestHandler : BaseRequestHandler {
285
277
UniValue PrepareRequest (const std::string& method, const std::vector<std::string>& args) override
286
278
{
287
279
if (!args.empty ()) {
@@ -320,9 +312,7 @@ class AddrinfoRequestHandler : public BaseRequestHandler
320
312
};
321
313
322
314
/* * Process getinfo requests */
323
- class GetinfoRequestHandler : public BaseRequestHandler
324
- {
325
- public:
315
+ struct GetinfoRequestHandler : BaseRequestHandler {
326
316
const int ID_NETWORKINFO = 0 ;
327
317
const int ID_BLOCKCHAININFO = 1 ;
328
318
const int ID_WALLETINFO = 2 ;
@@ -767,8 +757,7 @@ class GenerateToAddressRequestHandler : public BaseRequestHandler
767
757
};
768
758
769
759
/* * Process default single requests */
770
- class DefaultRequestHandler : public BaseRequestHandler {
771
- public:
760
+ struct DefaultRequestHandler : BaseRequestHandler {
772
761
UniValue PrepareRequest (const std::string& method, const std::vector<std::string>& args) override
773
762
{
774
763
UniValue params;
0 commit comments