@@ -898,6 +898,7 @@ bool RateLimitExceeded(double& dCount, int64_t& nLastTime, int64_t nLimit, unsig
898898
899899 LOCK (csLimiter);
900900
901+ // Use an exponentially decaying ~10-minute window:
901902 dCount *= pow (1.0 - 1.0 /600.0 , (double )(nNow - nLastTime));
902903 nLastTime = nNow;
903904 if (dCount >= nLimit*10 *1000 )
@@ -1018,7 +1019,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
10181019 static int64_t nLastFreeTime;
10191020 static int64_t nFreeLimit = GetArg (" -limitfreerelay" , 15 );
10201021
1021- if (RateLimitExceeded (dFreeCount, nLastFreeTime, nFreeLimit, nSize))
1022+ if (RateLimitExceeded (dFreeCount, nLastFreeTime, nFreeLimit, nSize))
10221023 return state.DoS (0 , error (" AcceptToMemoryPool : free transaction rejected by rate limiter" ),
10231024 REJECT_INSUFFICIENTFEE, " insufficient priority" );
10241025
@@ -1045,7 +1046,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
10451046 return true ;
10461047}
10471048
1048- static void RelayDoubleSpend (const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock , CBloomFilter& filter)
1049+ static void
1050+ RelayDoubleSpend (const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock , CBloomFilter& filter)
10491051{
10501052 // Relaying double-spend attempts to our peers lets them detect when
10511053 // somebody might be trying to cheat them. However, blindly relaying
0 commit comments