Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 1,982 Lines • ▼ Show 20 Lines | const CBlockIndex *pindexLast = nullptr; | ||||
// If we don't have the last header, then they'll have given us | // If we don't have the last header, then they'll have given us | ||||
// something new (if these headers are valid). | // something new (if these headers are valid). | ||||
if (!LookupBlockIndex(hashLastBlock)) { | if (!LookupBlockIndex(hashLastBlock)) { | ||||
received_new_header = true; | received_new_header = true; | ||||
} | } | ||||
} | } | ||||
CValidationState state; | CValidationState state; | ||||
CBlockHeader first_invalid_header; | if (!ProcessNewBlockHeaders(config, headers, state, &pindexLast)) { | ||||
if (!ProcessNewBlockHeaders(config, headers, state, &pindexLast, | |||||
&first_invalid_header)) { | |||||
if (state.IsInvalid()) { | if (state.IsInvalid()) { | ||||
MaybePunishNode(pfrom->GetId(), state, via_compact_block, | MaybePunishNode(pfrom->GetId(), state, via_compact_block, | ||||
"invalid header received"); | "invalid header received"); | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 3,085 Lines • Show Last 20 Lines |