Make max number of orphan blocks kept in memory a startup parameter (fixes #4253)
Rebased-From: 7b45d943b2
Conflicts:
src/init.cpp
src/main.h
This commit is contained in:
parent
8a88bb6550
commit
5cda7594f0
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue