Skip to content

Commit 729de15

Browse files
committed
Merge #9604: [Trivial] add comment about setting peer as HB peer.
dd5b011 [Trivial] add comment about setting peer as HB peer. (John Newbery)
2 parents 02464da + dd5b011 commit 729de15

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/net_processing.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,15 @@ void PeerLogicValidation::BlockChecked(const CBlock& block, const CValidationSta
863863
Misbehaving(it->second.first, nDoS);
864864
}
865865
}
866-
else if (state.IsValid() && !IsInitialBlockDownload() && mapBlocksInFlight.count(hash) == mapBlocksInFlight.size()) {
866+
// Check that:
867+
// 1. The block is valid
868+
// 2. We're not in initial block download
869+
// 3. This is currently the best block we're aware of. We haven't updated
870+
// the tip yet so we have no way to check this directly here. Instead we
871+
// just check that there are currently no other blocks in flight.
872+
else if (state.IsValid() &&
873+
!IsInitialBlockDownload() &&
874+
mapBlocksInFlight.count(hash) == mapBlocksInFlight.size()) {
867875
if (it != mapBlockSource.end()) {
868876
MaybeSetPeerAsAnnouncingHeaderAndIDs(it->second.first, *connman);
869877
}

0 commit comments

Comments
 (0)