diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-07-02 20:09:07 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-07-02 20:09:28 +0200 |
| commit | d6db1157bcab7ace13f046bdfa107b456c1dfbe3 (patch) | |
| tree | 3c4206aa2948ba6a72aab519fa71b023607c3a75 /src/rpcserver.cpp | |
| parent | Merge pull request #6361 (diff) | |
| parent | When processing RPC commands during warmup phase, parse the (diff) | |
| download | discoin-d6db1157bcab7ace13f046bdfa107b456c1dfbe3.tar.xz discoin-d6db1157bcab7ace13f046bdfa107b456c1dfbe3.zip | |
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)
Diffstat (limited to 'src/rpcserver.cpp')
| -rw-r--r-- | src/rpcserver.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 13b8661c6..287cfb2f1 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -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) |