Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static bool rest_tx(Config &config, HTTPRequest *req, | static bool rest_tx(Config &config, HTTPRequest *req, | ||||
const std::string &strURIPart) { | const std::string &strURIPart) { | ||||
if (!CheckWarmup(req)) return false; | if (!CheckWarmup(req)) return false; | ||||
std::string hashStr; | std::string hashStr; | ||||
const RetFormat rf = ParseDataFormat(hashStr, strURIPart); | const RetFormat rf = ParseDataFormat(hashStr, strURIPart); | ||||
uint256 hash; | TxHash hash; | ||||
if (!ParseHashStr(hashStr, hash)) | if (!ParseHashStr(hashStr, hash)) | ||||
return RESTERR(req, HTTP_BAD_REQUEST, "Invalid hash: " + hashStr); | return RESTERR(req, HTTP_BAD_REQUEST, "Invalid hash: " + hashStr); | ||||
CTransactionRef tx; | CTransactionRef tx; | ||||
uint256 hashBlock = uint256(); | uint256 hashBlock = uint256(); | ||||
if (!GetTransaction(config, hash, tx, hashBlock, true)) { | if (!GetTransaction(config, hash, tx, hashBlock, true)) { | ||||
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found"); | return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines |