|
|
@ -898,6 +898,7 @@ bool RateLimitExceeded(double& dCount, int64_t& nLastTime, int64_t nLimit, unsig |
|
|
|
|
|
|
|
|
|
|
|
LOCK(csLimiter); |
|
|
|
LOCK(csLimiter); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Use an exponentially decaying ~10-minute window:
|
|
|
|
dCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime)); |
|
|
|
dCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime)); |
|
|
|
nLastTime = nNow; |
|
|
|
nLastTime = nNow; |
|
|
|
if (dCount >= nLimit*10*1000) |
|
|
|
if (dCount >= nLimit*10*1000) |
|
|
@ -1045,7 +1046,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) |
|
|
|
static void |
|
|
|
|
|
|
|
RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Relaying double-spend attempts to our peers lets them detect when
|
|
|
|
// Relaying double-spend attempts to our peers lets them detect when
|
|
|
|
// somebody might be trying to cheat them. However, blindly relaying
|
|
|
|
// somebody might be trying to cheat them. However, blindly relaying
|
|
|
|