Drop JSONRPCRequest constructors after #21366

This just makes an additional simplification after #21366 replaced
util::Ref with std::any. It was originally suggested
https://github.com/bitcoin/bitcoin/pull/21366#issuecomment-792044351 but
delayed for a followup. It would have prevented usage bug
https://github.com/bitcoin/bitcoin/pull/21572.
This commit is contained in:
Russell Yanofsky
2021-04-02 13:35:01 -04:00
parent aa69471ecd
commit 9044522ef7
10 changed files with 28 additions and 41 deletions

View File

@@ -788,7 +788,7 @@ static bool InitSanityCheck()
return true;
}
static bool AppInitServers(const std::any& context, NodeContext& node)
static bool AppInitServers(NodeContext& node)
{
const ArgsManager& args = *Assert(node.args);
RPCServer::OnStarted(&OnRPCStarted);
@@ -797,9 +797,9 @@ static bool AppInitServers(const std::any& context, NodeContext& node)
return false;
StartRPC();
node.rpc_interruption_point = RpcInterruptionPoint;
if (!StartHTTPRPC(context))
if (!StartHTTPRPC(&node))
return false;
if (args.GetBoolArg("-rest", DEFAULT_REST_ENABLE)) StartREST(context);
if (args.GetBoolArg("-rest", DEFAULT_REST_ENABLE)) StartREST(&node);
StartHTTPServer();
return true;
}
@@ -1277,7 +1277,7 @@ bool AppInitInterfaces(NodeContext& node)
return true;
}
bool AppInitMain(const std::any& context, NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
{
const ArgsManager& args = *Assert(node.args);
const CChainParams& chainparams = Params();
@@ -1382,7 +1382,7 @@ bool AppInitMain(const std::any& context, NodeContext& node, interfaces::BlockAn
*/
if (args.GetBoolArg("-server", false)) {
uiInterface.InitMessage_connect(SetRPCWarmupStatus);
if (!AppInitServers(context, node))
if (!AppInitServers(node))
return InitError(_("Unable to start HTTP server. See debug log for details."));
}