From f4c72a3fc1e8a1593c672e1321053d2679ed0e37 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Wed, 10 May 2017 09:06:06 +0800 Subject: [PATCH] started upadting readme with new api/mempool example --- README.md | 12 ++++++++++++ main.cpp | 2 +- src/page.h | 6 +++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 67467d5..6003f12 100644 --- a/README.md +++ b/README.md @@ -383,6 +383,7 @@ Partial results shown: #### api/mempool +Return all txs in the mempool. ```bash curl -w "\n" -X GET "http://139.162.32.245:8081/api/mempool" @@ -414,6 +415,17 @@ Partial results shown: } ``` + +#### api/mempool?limit= + +Return number of newest mempool txs, e.g., only 10. + +```bash +curl -w "\n" -X GET "http://139.162.32.245:8081/api/mempool?limit=10" +``` + +Result analogical to the one above. + #### api/search/ ```bash diff --git a/main.cpp b/main.cpp index 2345524..cf60a23 100644 --- a/main.cpp +++ b/main.cpp @@ -393,7 +393,7 @@ int main(int ac, const char* av[]) { 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 + // a call to api/mempool without any limit return all // mempool txs string limit = regex_search(req.raw_url, regex {"limit=\\d+"}) ? req.url_params.get("limit") : "100000000"; diff --git a/src/page.h b/src/page.h index 299047c..5d47fc8 100644 --- a/src/page.h +++ b/src/page.h @@ -4214,9 +4214,9 @@ namespace xmreg /* - * Lets use this json api convention for success and error - * https://labs.omniti.com/labs/jsend - */ + * Lets use this json api convention for success and error + * https://labs.omniti.com/labs/jsend + */ json json_search(const string& search_text) {