Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 567 Lines • ▼ Show 20 Lines | for (const CTxIn &txin : tx.vin) { | ||||
LOCK(csFreeLimiter); | LOCK(csFreeLimiter); | ||||
// Use an exponentially decaying ~10-minute window: | // Use an exponentially decaying ~10-minute window: | ||||
dFreeCount *= pow(1.0 - 1.0 / 600.0, double(nNow - nLastTime)); | dFreeCount *= pow(1.0 - 1.0 / 600.0, double(nNow - nLastTime)); | ||||
nLastTime = nNow; | nLastTime = nNow; | ||||
// -limitfreerelay unit is thousand-bytes-per-minute | // -limitfreerelay unit is thousand-bytes-per-minute | ||||
// At default rate it would take over a month to fill 1GB | // At default rate it would take over a month to fill 1GB | ||||
// NOTE: Use the actual size here, and not the fee size since this | |||||
// is counting real size for the rate limiter. | |||||
if (dFreeCount + nSize >= | if (dFreeCount + nSize >= | ||||
gArgs.GetArg("-limitfreerelay", DEFAULT_LIMITFREERELAY) * 10 * | gArgs.GetArg("-limitfreerelay", DEFAULT_LIMITFREERELAY) * 10 * | ||||
1000) { | 1000) { | ||||
return state.DoS(0, false, REJECT_INSUFFICIENTFEE, | return state.DoS(0, false, REJECT_INSUFFICIENTFEE, | ||||
"rate limited free transaction"); | "rate limited free transaction"); | ||||
} | } | ||||
LogPrint(BCLog::MEMPOOL, "Rate limit dFreeCount: %g => %g\n", | LogPrint(BCLog::MEMPOOL, "Rate limit dFreeCount: %g => %g\n", | ||||
▲ Show 20 Lines • Show All 4,556 Lines • Show Last 20 Lines |