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:
Wladimir J. van der Laan 2015-07-02 20:09:07 +02:00
commit d6db1157bc
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 7 additions and 7 deletions

View File

@ -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 &params) 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)