diff --git a/main.cpp b/main.cpp index 82a1ff9..2345524 100644 --- a/main.cpp +++ b/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)}; diff --git a/src/page.h b/src/page.h index b6308aa..299047c 100644 --- a/src/page.h +++ b/src/page.h @@ -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