large default value for api/mempool if no limit given

This commit is contained in:
moneroexamples 2017-05-10 08:49:59 +08:00
parent eac4fa8460
commit eb735a14dc
2 changed files with 8 additions and 2 deletions

View File

@ -392,8 +392,11 @@ int main(int ac, const char* av[]) {
string page = regex_search(req.raw_url, regex {"page=\\d+"}) ?
req.url_params.get("page") : "0";
// default value for limit is some large number, so that
// a call to api/mempool without any arguments return all
// mempool txs
string limit = regex_search(req.raw_url, regex {"limit=\\d+"}) ?
req.url_params.get("limit") : "25";
req.url_params.get("limit") : "100000000";
myxmr::jsonresponse r{xmrblocks.json_mempool(page, limit)};

View File

@ -4181,7 +4181,10 @@ namespace xmreg
}
catch (const std::out_of_range& e)
{
break;
j_response["status"] = "error";
j_response["message"] = fmt::format("Getting mempool txs failed due to std::out_of_range");
return j_response;
}
const tx_details& txd = get_tx_details(a_pair->second, false, 1, height); // 1 is dummy here