From bbde1e99c893924dbef135f42c14f4df9828c6e5 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 11 Jan 2014 17:28:34 +0100 Subject: Limit the number of orphan blocks In case the total number of orphan blocks in memory exceeds a limit (currently set to 750), a random orphan block (which is not depended on by another orphan block) is dropped. This means it will need to be downloaded again, but it won't consume memory until then. --- src/main.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index bbf6fce48b..05210e5164 100644 --- a/src/main.h +++ b/src/main.h @@ -45,6 +45,8 @@ static const unsigned int MAX_STANDARD_TX_SIZE = 100000; static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** The maximum number of orphan transactions kept in memory */ static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; +/** The maximum number of orphan blocks kept in memory */ +static const unsigned int MAX_ORPHAN_BLOCKS = 750; /** The maximum size of a blk?????.dat file (since 0.8) */ static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB /** The pre-allocation chunk size for blk?????.dat files (since 0.8) */ -- cgit v1.2.3