mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-10 23:27:54 +00:00
Merge pull request #6362
72b9452
When processing RPC commands during warmup phase, parse the request object before returning an error so that id value can be used in the response. (Forrest Voight)
This commit is contained in:
commit
d6db1157bc
@ -931,13 +931,6 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn,
|
||||
if (!valRequest.read(strRequest))
|
||||
throw JSONRPCError(RPC_PARSE_ERROR, "Parse error");
|
||||
|
||||
// Return immediately if in warmup
|
||||
{
|
||||
LOCK(cs_rpcWarmup);
|
||||
if (fRPCInWarmup)
|
||||
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
|
||||
}
|
||||
|
||||
string strReply;
|
||||
|
||||
// singleton request
|
||||
@ -1009,6 +1002,13 @@ void ServiceConnection(AcceptedConnection *conn)
|
||||
|
||||
UniValue CRPCTable::execute(const std::string &strMethod, const UniValue ¶ms) const
|
||||
{
|
||||
// Return immediately if in warmup
|
||||
{
|
||||
LOCK(cs_rpcWarmup);
|
||||
if (fRPCInWarmup)
|
||||
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
|
||||
}
|
||||
|
||||
// Find method
|
||||
const CRPCCommand *pcmd = tableRPC[strMethod];
|
||||
if (!pcmd)
|
||||
|
Loading…
Reference in New Issue
Block a user