Skip to content

Commit c558eba

Browse files
ajtownssdaftuar
authored andcommitted
LookupBlockIndex -> CACHED_INVALID
1 parent 6e3332a commit c558eba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::ve
15581558
CBlockHeader first_invalid_header;
15591559
if (!ProcessNewBlockHeaders(headers, state, chainparams, &pindexLast, &first_invalid_header)) {
15601560
if (state.IsInvalid()) {
1561-
if (punish_duplicate_invalid && LookupBlockIndex(first_invalid_header.GetHash())) {
1561+
if (punish_duplicate_invalid && state.GetReason() == ValidationInvalidReason::CACHED_INVALID) {
15621562
// Goal: don't allow outbound peers to use up our outbound
15631563
// connection slots if they are on incompatible chains.
15641564
//

0 commit comments

Comments
 (0)