From 94cf9e41d5da69f17c6897317f48292afd3bc28c Mon Sep 17 00:00:00 2001 From: michilumin Date: Sat, 27 Sep 2014 14:30:53 -0600 Subject: Initial check in of branch for conflict resolution --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index f6e709365..b9ca00d71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4116,7 +4116,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); } -- cgit v1.2.3 From 5cda7594f0a9cc2f343061128483f50810368cbd Mon Sep 17 00:00:00 2001 From: shshshsh Date: Fri, 30 May 2014 12:35:23 +0000 Subject: Make max number of orphan blocks kept in memory a startup parameter (fixes #4253) Rebased-From: 7b45d943b29a443f1ac808c9ee4eeed6df0db9cc Conflicts: src/init.cpp src/main.h --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b9ca00d71..db9d4bf45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1181,7 +1181,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. -- cgit v1.2.3