So, I have extracted the following classes and functions into a new include rpc/interfaces.h
0class RPCTimerBase
1class RPCTimerInterface
2class CRPCCommand
3class CRPCTable
4std::string JSONRPCExecBatch(const JSONRPCRequest& jreq, const UniValue& vReq);
5void RPCSetTimerInterface(RPCTimerInterface *iface);
6void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface);
7void RPCUnsetTimerInterface(RPCTimerInterface *iface);
A test run with circular-dependencies.py
script shows no httprpc->server->httprpc anymore (but there are other unrelated circular dependencies still)
I have thought about extracting their implementations in rpc/server.cpp as well, but as this would look even more invasive, I’ll remain with this single include file for now.
I think, I should open a separate PR and let others discuss about it. And if it gets merged, I’ll rebase this PR afterwards.