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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user