mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
large default value for api/mempool if no limit given
This commit is contained in:
parent
eac4fa8460
commit
eb735a14dc
2 changed files with 8 additions and 2 deletions
5
main.cpp
5
main.cpp
|
@ -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)};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue