MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / LimitMempoolSize

Function LimitMempoolSize

src/validation.cpp:447–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consensus::Params& chainparams);
446
447static void LimitMempoolSize(CTxMemPool& pool, size_t limit, unsigned long age) {
448 int expired = pool.Expire(GetTime() - age);
449 if (expired != 0) {
450 LogPrint(BCLog::MEMPOOL, "Expired %i transactions from the memory pool\n", expired);
451 }
452
453 std::vector<COutPoint> vNoSpendsRemaining;
454 pool.TrimToSize(limit, &vNoSpendsRemaining);
455 for (const COutPoint& removed : vNoSpendsRemaining)
456 pcoinsTip->Uncache(removed);
457}
458
459/** Convert CValidationState to a human-readable message for logging */
460std::string FormatStateMessage(const CValidationState &state)

Callers 2

UpdateMempoolForReorgFunction · 0.85
AcceptToMemoryPoolWorkerFunction · 0.85

Calls 4

GetTimeFunction · 0.85
ExpireMethod · 0.80
TrimToSizeMethod · 0.80
UncacheMethod · 0.80

Tested by

no test coverage detected