Improve handling of unconnecting headers

This commit is contained in:
Suhas Daftuar
2016-07-06 21:18:38 -04:00
committed by lateminer
parent f178b7d0a3
commit 75e463decf
2 changed files with 42 additions and 3 deletions

View File

@@ -126,6 +126,9 @@ static const bool DEFAULT_ENABLE_REPLACEMENT = true;
/** Maximum number of headers to announce when relaying blocks with headers message.*/
static const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8;
/** Maximum number of unconnecting headers announcements before DoS score */
static const int MAX_UNCONNECTING_HEADERS = 10;
struct BlockHasher
{
size_t operator()(const uint256& hash) const { return hash.GetCheapHash(); }