From 7df16e70e67c753c871797ce947ea09d7cb0e519 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 17 Jan 2019 14:33:16 +1000 Subject: [PATCH] LookupBlockIndex -> CACHED_INVALID Co-authored-by: Anthony Towns --- src/net_processing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index a416093db..5c5faa130 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1578,7 +1578,7 @@ bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::ve CBlockHeader first_invalid_header; if (!ProcessNewBlockHeaders(headers, state, chainparams, &pindexLast, &first_invalid_header)) { if (state.IsInvalid()) { - if (punish_duplicate_invalid && LookupBlockIndex(first_invalid_header.GetHash())) { + if (punish_duplicate_invalid && state.GetReason() == ValidationInvalidReason::CACHED_INVALID) { // Goal: don't allow outbound peers to use up our outbound // connection slots if they are on incompatible chains. //