aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorptschip <[email protected]>2015-10-16 18:18:16 -0700
committerptschip <[email protected]>2016-01-06 10:15:00 -0800
commit2dfeaa1ad03e7768fb28bfde7f929ac57dfff120 (patch)
tree3c7d6bf3ec77dd2dfd919c3d7bf8da3e3dc44f87 /src/main.cpp
parentMerge pull request #7125 (diff)
downloaddiscoin-2dfeaa1ad03e7768fb28bfde7f929ac57dfff120.tar.xz
discoin-2dfeaa1ad03e7768fb28bfde7f929ac57dfff120.zip
limitfreerelay edge case bugfix:
If a new transaction will cause limitfreerelay to be exceeded it should not be accepted into the memory pool and the byte counter should be updated only after the fact.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 41fc0b809..08a95aff2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1016,7 +1016,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C
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", DEFAULT_LIMITFREERELAY) * 10 * 1000)
+ if (dFreeCount + nSize >= GetArg("-limitfreerelay", DEFAULT_LIMITFREERELAY) * 10 * 1000)
return state.DoS(0, false, REJECT_INSUFFICIENTFEE, "rate limited free transaction");
LogPrint("mempool", "Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount+nSize);
dFreeCount += nSize;