aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2014-08-06 23:58:19 -0400
committerJeff Garzik <jgarzik@bitpay.com>2014-08-14 12:34:38 -0400
commit6f2c26a457d279138d23d0f321edf55cd6b1f72f (patch)
treece209c55c8ede839f538481135bf6949523db5cc /src/txmempool.h
parent7accb7dbad6bef0c98dc436d164f27189294eaf5 (diff)
Closely track mempool byte total. Add "getmempoolinfo" RPC.
Goal: Gain live insight into the mempool. Groundwork for future work that caps mempool size.
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index 41b2c52f39..2577397bce 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -68,6 +68,7 @@ private:
CMinerPolicyEstimator* minerPolicyEstimator;
CFeeRate minRelayFee; // Passed to constructor to avoid dependency on main
+ uint64_t totalTxSize; // sum of all mempool tx' byte sizes
public:
mutable CCriticalSection cs;
@@ -108,6 +109,11 @@ public:
LOCK(cs);
return mapTx.size();
}
+ uint64_t GetTotalTxSize()
+ {
+ LOCK(cs);
+ return totalTxSize;
+ }
bool exists(uint256 hash)
{