Implement accurate memory accounting for mempool
This commit is contained in:
committed by
Jack Grigg
parent
a28b17b7b7
commit
bde5c8b0f1
@@ -787,6 +787,7 @@ UniValue getmempoolinfo(const UniValue& params, bool fHelp)
|
||||
"{\n"
|
||||
" \"size\": xxxxx (numeric) Current tx count\n"
|
||||
" \"bytes\": xxxxx (numeric) Sum of all tx sizes\n"
|
||||
" \"usage\": xxxxx (numeric) Total memory usage for the mempool\n"
|
||||
"}\n"
|
||||
"\nExamples:\n"
|
||||
+ HelpExampleCli("getmempoolinfo", "")
|
||||
@@ -796,6 +797,7 @@ UniValue getmempoolinfo(const UniValue& params, bool fHelp)
|
||||
UniValue ret(UniValue::VOBJ);
|
||||
ret.push_back(Pair("size", (int64_t) mempool.size()));
|
||||
ret.push_back(Pair("bytes", (int64_t) mempool.GetTotalTxSize()));
|
||||
ret.push_back(Pair("usage", (int64_t) mempool.DynamicMemoryUsage()));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user