diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-08-15 10:53:23 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-08-15 14:09:33 +0200 |
| commit | 984ff68c679e9a40e14e791c6363c6136639a686 (patch) | |
| tree | 71f67460c82fb19e45cde56c6654bbb148a25f38 /src/rpcblockchain.cpp | |
| parent | build: fix automake warnings about the use of INCLUDES (diff) | |
| parent | Closely track mempool byte total. Add "getmempoolinfo" RPC. (diff) | |
| download | discoin-984ff68c679e9a40e14e791c6363c6136639a686.tar.xz discoin-984ff68c679e9a40e14e791c6363c6136639a686.zip | |
Merge pull request #4638
6f2c26a Closely track mempool byte total. Add "getmempoolinfo" RPC. (Jeff Garzik)
Diffstat (limited to 'src/rpcblockchain.cpp')
| -rw-r--r-- | src/rpcblockchain.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 1e5198b85..e511fe422 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -531,3 +531,27 @@ Value getchaintips(const Array& params, bool fHelp) return res; } + +Value getmempoolinfo(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 0) + throw runtime_error( + "getmempoolinfo\n" + "\nReturns details on the active state of the TX memory pool.\n" + "\nResult:\n" + "{\n" + " \"size\": xxxxx (numeric) Current tx count\n" + " \"bytes\": xxxxx (numeric) Sum of all tx sizes\n" + "}\n" + "\nExamples:\n" + + HelpExampleCli("getmempoolinfo", "") + + HelpExampleRpc("getmempoolinfo", "") + ); + + Object ret; + ret.push_back(Pair("size", (int64_t) mempool.size())); + ret.push_back(Pair("bytes", (int64_t) mempool.GetTotalTxSize())); + + return ret; +} + |