@@ -3806,30 +3806,7 @@ void PeerManagerImpl::ProcessMessage(
3806
3806
statsClient.inc (strprintf (" message.received.inv_%s" , inv.GetCommand ()), 1 .0f );
3807
3807
3808
3808
UpdateBlockAvailability (pfrom.GetId (), inv.hash );
3809
-
3810
- if (fAlreadyHave || fImporting || fReindex || mapBlocksInFlight.count (inv.hash )) {
3811
- continue ;
3812
- }
3813
-
3814
- CNodeState *state = State (pfrom.GetId ());
3815
- if (!state) {
3816
- continue ;
3817
- }
3818
-
3819
- // Download if this is a nice peer, or we have no nice peers and this one might do.
3820
- bool fFetch = state->fPreferredDownload || (nPreferredDownload == 0 && !pfrom.IsAddrFetchConn ());
3821
- // Only actively request headers from a single peer, unless we're close to end of initial download.
3822
- if ((nSyncStarted == 0 && fFetch ) || m_chainman.m_best_header ->GetBlockTime () > GetAdjustedTime () - nMaxTipAge) {
3823
- // Make sure to mark this peer as the one we are currently syncing with etc.
3824
- state->fSyncStarted = true ;
3825
- state->m_headers_sync_timeout = current_time + HEADERS_DOWNLOAD_TIMEOUT_BASE +
3826
- (
3827
- // Convert HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER to microseconds before scaling
3828
- // to maintain precision
3829
- std::chrono::microseconds{HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER} *
3830
- (GetAdjustedTime () - m_chainman.m_best_header ->GetBlockTime ()) / m_chainparams.GetConsensus ().nPowTargetSpacing
3831
- );
3832
- nSyncStarted++;
3809
+ if (!fAlreadyHave && !fImporting && !fReindex && !mapBlocksInFlight.count (inv.hash )) {
3833
3810
// Headers-first is the primary method of announcement on
3834
3811
// the network. If a node fell back to sending blocks by inv,
3835
3812
// it's probably for a re-org. The final block hash
0 commit comments