From 70180b2e576ebcb675c905ef4bd9d5b4fd378b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Thu, 6 Aug 2015 19:38:19 +0200 Subject: Implement REST mempool API, add test and documentation. --- doc/REST-interface.md | 14 ++++++++ qa/rpc-tests/rest.py | 13 +++++++ src/rest.cpp | 56 +++++++++++++++++++++++++++++ src/rpcblockchain.cpp | 97 ++++++++++++++++++++++++++++----------------------- 4 files changed, 136 insertions(+), 44 deletions(-) diff --git a/doc/REST-interface.md b/doc/REST-interface.md index ac7cd45f70..bf669235e3 100644 --- a/doc/REST-interface.md +++ b/doc/REST-interface.md @@ -77,6 +77,20 @@ $ curl localhost:18332/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff76 } ``` +####Memory pool +`GET /rest/mempool/info.json` + +Returns various information about the TX mempool. +Only supports JSON as output format. +* size : (numeric) the number of transactions in the TX mempool +* bytes : (numeric) size of the TX mempool in bytes +* usage : (numeric) total TX mempool memory usage + +`GET /rest/mempool/contents.json` + +Returns transactions in the TX mempool. +Only supports JSON as output format. + Risks ------------- Running a web browser on the same node with a REST enabled bitcoind can be a risk. Accessing prepared XSS websites could read out tx/block data of your node by placing links like `