Improve handling of unconnecting headers

When processing a headers message that looks like a block announcement,
send peer a getheaders if the headers message won't connect.

Apply DoS points after too many consecutive unconnecting headers messages.
This commit is contained in:
Suhas Daftuar
2016-07-06 21:18:38 -04:00
parent b978701ba1
commit 96fa95361f
2 changed files with 40 additions and 1 deletions

View File

@@ -138,6 +138,9 @@ static const bool DEFAULT_FEEFILTER = 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;
static const bool DEFAULT_PEERBLOOMFILTERS = true;
struct BlockHasher