Closely track mempool byte total. Add "getmempoolinfo" RPC.

Goal:  Gain live insight into the mempool.  Groundwork for future work
that caps mempool size.
This commit is contained in:
Jeff Garzik
2014-08-06 23:58:19 -04:00
parent 7accb7dbad
commit 6f2c26a457
5 changed files with 41 additions and 0 deletions

View File

@@ -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)
{