mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Check message identifier in RPCSession
This commit is contained in:
parent
110b9a6232
commit
e1780e3ae8
@ -326,6 +326,14 @@ Json::Value RPCSession::rpcCall(string const& _methodName, vector<string> const&
|
||||
if (!jsonParseStrict(reply, result, &errorMsg))
|
||||
BOOST_REQUIRE_MESSAGE(false, errorMsg);
|
||||
|
||||
if (!result.isMember("id") || !result["id"].isUInt())
|
||||
BOOST_FAIL("Badly formatted JSON-RPC response (missing or non-integer \"id\")");
|
||||
if (result["id"].asUInt() != (m_rpcSequence - 1))
|
||||
BOOST_FAIL(
|
||||
"Response identifier mismatch. "
|
||||
"Expected " + to_string(m_rpcSequence - 1) + " but got " + to_string(result["id"].asUInt()) + "."
|
||||
);
|
||||
|
||||
if (result.isMember("error"))
|
||||
{
|
||||
if (_canFail)
|
||||
|
Loading…
Reference in New Issue
Block a user