Skip to content

Commit 7df16e7

Browse files
TheBlueMattajtowns
authored andcommitted
LookupBlockIndex -> CACHED_INVALID
Co-authored-by: Anthony Towns <[email protected]>
1 parent c8b0d22 commit 7df16e7

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
@@ -1578,7 +1578,7 @@ bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::ve
15781578
CBlockHeader first_invalid_header;
15791579
if (!ProcessNewBlockHeaders(headers, state, chainparams, &pindexLast, &first_invalid_header)) {
15801580
if (state.IsInvalid()) {
1581-
if (punish_duplicate_invalid && LookupBlockIndex(first_invalid_header.GetHash())) {
1581+
if (punish_duplicate_invalid && state.GetReason() == ValidationInvalidReason::CACHED_INVALID) {
15821582
// Goal: don't allow outbound peers to use up our outbound
15831583
// connection slots if they are on incompatible chains.
15841584
//

0 commit comments

Comments
 (0)