Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 463 Lines • ▼ Show 20 Lines | if (uriParts.size() > 0) { | ||||
// inputs is sent over URI scheme | // inputs is sent over URI scheme | ||||
// (/rest/getutxos/checkmempool/txid1-n/txid2-n/...) | // (/rest/getutxos/checkmempool/txid1-n/txid2-n/...) | ||||
if (uriParts[0] == "checkmempool") { | if (uriParts[0] == "checkmempool") { | ||||
fCheckMemPool = true; | fCheckMemPool = true; | ||||
} | } | ||||
for (size_t i = (fCheckMemPool) ? 1 : 0; i < uriParts.size(); i++) { | for (size_t i = (fCheckMemPool) ? 1 : 0; i < uriParts.size(); i++) { | ||||
int32_t nOutput; | int32_t nOutput; | ||||
std::string strTxid = uriParts[i].substr(0, uriParts[i].find("-")); | std::string strTxid = uriParts[i].substr(0, uriParts[i].find('-')); | ||||
std::string strOutput = | std::string strOutput = | ||||
uriParts[i].substr(uriParts[i].find("-") + 1); | uriParts[i].substr(uriParts[i].find('-') + 1); | ||||
if (!ParseInt32(strOutput, &nOutput) || !IsHex(strTxid)) { | if (!ParseInt32(strOutput, &nOutput) || !IsHex(strTxid)) { | ||||
return RESTERR(req, HTTP_BAD_REQUEST, "Parse error"); | return RESTERR(req, HTTP_BAD_REQUEST, "Parse error"); | ||||
} | } | ||||
TxId txid; | TxId txid; | ||||
txid.SetHex(strTxid); | txid.SetHex(strTxid); | ||||
vOutPoints.push_back(COutPoint(txid, uint32_t(nOutput))); | vOutPoints.push_back(COutPoint(txid, uint32_t(nOutput))); | ||||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |