mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Consolidate redundant implementations of ParseHashStr
This change: * adds a length check to ParseHashStr, appropriate given its use to populate a 256-bit number from a hex str. * allows the caller to handle the failure, which allows for the more appropriate JSONRPCError on failure in prioritisetransaction rpc
This commit is contained in:
@@ -105,15 +105,6 @@ static std::string AvailableDataFormatsString()
|
||||
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)
|
||||
{
|
||||
std::string statusmessage;
|
||||
|
||||
Reference in New Issue
Block a user