aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2014-09-28 13:29:04 +0000
committerRoss Nicoll <[email protected]>2014-09-28 13:29:04 +0000
commit76ebacb657b69afd2ad559eb34b57a7d37a3500a (patch)
tree0ac009f5109d41e82155e200fb531c8deedb4ab3 /src/main.cpp
parentMerge pull request #716 from patricklodder/1.8.1-dev-lang-cleanup (diff)
parentFrom Bitcoin: ea3c1b0 and Bitcoin: af25208: Add maximum orphan blocks and ma... (diff)
downloadarchived-discoin-76ebacb657b69afd2ad559eb34b57a7d37a3500a.tar.xz
archived-discoin-76ebacb657b69afd2ad559eb34b57a7d37a3500a.zip
Merge pull request #718 from michilumin/1.8.1-dev-limit-orphan-tx
1.8.1 dev limit orphan tx
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 881582f41..e4898fe89 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1184,7 +1184,7 @@ uint256 static GetOrphanRoot(const uint256& hash)
// Remove a random orphan block (which does not have any dependent orphans).
void static PruneOrphanBlocks()
{
- if (mapOrphanBlocksByPrev.size() <= MAX_ORPHAN_BLOCKS)
+ if (mapOrphanBlocksByPrev.size() <= (size_t)std::max((int64_t)0, GetArg("-maxorphanblocks", DEFAULT_MAX_ORPHAN_BLOCKS)))
return;
// Pick a random orphan block.
@@ -4121,7 +4121,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
AddOrphanTx(tx);
// DoS prevention: do not allow mapOrphanTransactions to grow unbounded
- unsigned int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS);
+ unsigned int nMaxOrphanTx = (unsigned int)std::max((int64_t)0, GetArg("-maxorphantx", DEFAULT_MAX_ORPHAN_TRANSACTIONS));
+ unsigned int nEvicted = LimitOrphanTxSize(nMaxOrphanTx);
if (nEvicted > 0)
LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted);
}