Skip to content

Commit d6db115

Browse files
committed
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)
2 parents d7ada03 + 72b9452 commit d6db115

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/rpcserver.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -931,13 +931,6 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn,
931931
if (!valRequest.read(strRequest))
932932
throw JSONRPCError(RPC_PARSE_ERROR, "Parse error");
933933

934-
// Return immediately if in warmup
935-
{
936-
LOCK(cs_rpcWarmup);
937-
if (fRPCInWarmup)
938-
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
939-
}
940-
941934
string strReply;
942935

943936
// singleton request
@@ -1009,6 +1002,13 @@ void ServiceConnection(AcceptedConnection *conn)
10091002

10101003
UniValue CRPCTable::execute(const std::string &strMethod, const UniValue &params) const
10111004
{
1005+
// Return immediately if in warmup
1006+
{
1007+
LOCK(cs_rpcWarmup);
1008+
if (fRPCInWarmup)
1009+
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
1010+
}
1011+
10121012
// Find method
10131013
const CRPCCommand *pcmd = tableRPC[strMethod];
10141014
if (!pcmd)

0 commit comments

Comments
 (0)