Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | static std::string AvailableDataFormatsString() { | ||||
if (formats.length() > 0) { | if (formats.length() > 0) { | ||||
return formats.substr(0, formats.length() - 2); | return formats.substr(0, formats.length() - 2); | ||||
} | } | ||||
return formats; | return formats; | ||||
} | } | ||||
static bool ParseHashStr(const std::string &strReq, uint256 &v) { | |||||
if (!IsHex(strReq) || (strReq.size() != 64)) { | |||||
return false; | |||||
} | |||||
v.SetHex(strReq); | |||||
return true; | |||||
} | |||||
static bool CheckWarmup(HTTPRequest *req) { | static bool CheckWarmup(HTTPRequest *req) { | ||||
std::string statusmessage; | std::string statusmessage; | ||||
if (RPCIsInWarmup(&statusmessage)) { | if (RPCIsInWarmup(&statusmessage)) { | ||||
return RESTERR(req, HTTP_SERVICE_UNAVAILABLE, | return RESTERR(req, HTTP_SERVICE_UNAVAILABLE, | ||||
"Service temporarily unavailable: " + statusmessage); | "Service temporarily unavailable: " + statusmessage); | ||||
} | } | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 557 Lines • Show Last 20 Lines |