Skip to content

Commit

Permalink
Merge bitcoin#9604: [Trivial] add comment about setting peer as HB peer.
Browse files Browse the repository at this point in the history
dd5b011 [Trivial] add comment about setting peer as HB peer. (John Newbery)
  • Loading branch information
laanwj committed Feb 7, 2017
2 parents 02464da + dd5b011 commit 729de15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,15 @@ void PeerLogicValidation::BlockChecked(const CBlock& block, const CValidationSta
Misbehaving(it->second.first, nDoS);
}
}
else if (state.IsValid() && !IsInitialBlockDownload() && mapBlocksInFlight.count(hash) == mapBlocksInFlight.size()) {
// Check that:
// 1. The block is valid
// 2. We're not in initial block download
// 3. This is currently the best block we're aware of. We haven't updated
// the tip yet so we have no way to check this directly here. Instead we
// just check that there are currently no other blocks in flight.
else if (state.IsValid() &&
!IsInitialBlockDownload() &&
mapBlocksInFlight.count(hash) == mapBlocksInFlight.size()) {
if (it != mapBlockSource.end()) {
MaybeSetPeerAsAnnouncingHeaderAndIDs(it->second.first, *connman);
}
Expand Down

0 comments on commit 729de15

Please sign in to comment.