Skip to content

Commit

Permalink
Merge #327: [Main] Don't limit zPIV spends from getting into the mempool
Browse files Browse the repository at this point in the history
1387fbd [Main] Don't limit zPIV spends from getting into the mempool (Fuzzbawls)

Tree-SHA512: 92ad0dce5ce033adbc5b32d3949b2e2557821c175068e6483dbc6fabcd5747875550d7f7c49ed4df77a3dc2f0b65f287578d4be112d643921d183c28af0aca07
  • Loading branch information
Mrs-X committed Oct 28, 2017
2 parents 8cdbb5d + 1387fbd commit aa1235a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransa
// Continuously rate-limit free (really, very-low-fee) transactions
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to
// be annoying or make others' transactions take longer to confirm.
if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize)) {
if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize) && !tx.IsZerocoinSpend()) {
static CCriticalSection csFreeLimiter;
static double dFreeCount;
static int64_t nLastTime;
Expand All @@ -1744,7 +1744,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransa
nLastTime = nNow;
// -limitfreerelay unit is thousand-bytes-per-minute
// At default rate it would take over a month to fill 1GB
if (dFreeCount >= GetArg("-limitfreerelay", 15) * 10 * 1000)
if (dFreeCount >= GetArg("-limitfreerelay", 30) * 10 * 1000)
return state.DoS(0, error("AcceptToMemoryPool : free transaction rejected by rate limiter"),
REJECT_INSUFFICIENTFEE, "rate limited free transaction");
LogPrint("mempool", "Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount + nSize);
Expand Down Expand Up @@ -1921,7 +1921,7 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState& state, const CTransact
// Continuously rate-limit free (really, very-low-fee) transactions
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to
// be annoying or make others' transactions take longer to confirm.
if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize)) {
if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize) && !tx.IsZerocoinSpend()) {
static CCriticalSection csFreeLimiter;
static double dFreeCount;
static int64_t nLastTime;
Expand All @@ -1934,7 +1934,7 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState& state, const CTransact
nLastTime = nNow;
// -limitfreerelay unit is thousand-bytes-per-minute
// At default rate it would take over a month to fill 1GB
if (dFreeCount >= GetArg("-limitfreerelay", 15) * 10 * 1000)
if (dFreeCount >= GetArg("-limitfreerelay", 30) * 10 * 1000)
return state.DoS(0, error("AcceptableInputs : free transaction rejected by rate limiter"),
REJECT_INSUFFICIENTFEE, "rate limited free transaction");
LogPrint("mempool", "Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount + nSize);
Expand Down

0 comments on commit aa1235a

Please sign in to comment.