@@ -6527,7 +6527,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
65276527 // Ping automatically sent as a latency probe & keepalive.
65286528 pingSend = true ;
65296529 }
6530- if (pingSend && !pto-> fDisconnect ) {
6530+ if (pingSend) {
65316531 uint64_t nonce = 0 ;
65326532 while (nonce == 0 ) {
65336533 GetRandBytes ((unsigned char *)&nonce, sizeof (nonce));
@@ -6610,7 +6610,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
66106610 if (pindexBestHeader == NULL )
66116611 pindexBestHeader = chainActive.Tip ();
66126612 bool fFetch = state.fPreferredDownload || (nPreferredDownload == 0 && !pto->fClient && !pto->fOneShot ); // Download if this is a nice peer, or we have no nice peers and this one might do.
6613- if (!state.fSyncStarted && !pto->fClient && !pto-> fDisconnect && ! fImporting && !fReindex ) {
6613+ if (!state.fSyncStarted && !pto->fClient && !fImporting && !fReindex ) {
66146614 // Only actively request headers from a single peer, unless we're close to today.
66156615 if ((nSyncStarted == 0 && fFetch ) || pindexBestHeader->GetBlockTime () > GetAdjustedTime () - 24 * 60 * 60 ) {
66166616 state.fSyncStarted = true ;
@@ -6897,7 +6897,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
68976897
68986898 // Detect whether we're stalling
68996899 nNow = GetTimeMicros ();
6900- if (!pto-> fDisconnect && state.nStallingSince && state.nStallingSince < nNow - 1000000 * BLOCK_STALLING_TIMEOUT) {
6900+ if (state.nStallingSince && state.nStallingSince < nNow - 1000000 * BLOCK_STALLING_TIMEOUT) {
69016901 // Stalling only triggers when the block download window cannot move. During normal steady state,
69026902 // the download window should be much larger than the to-be-downloaded set of blocks, so disconnection
69036903 // should only happen during initial block download.
@@ -6910,7 +6910,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
69106910 // We compensate for other peers to prevent killing off peers due to our own downstream link
69116911 // being saturated. We only count validated in-flight blocks so peers can't advertise non-existing block hashes
69126912 // to unreasonably increase our timeout.
6913- if (!pto-> fDisconnect && state.vBlocksInFlight .size () > 0 ) {
6913+ if (state.vBlocksInFlight .size () > 0 ) {
69146914 QueuedBlock &queuedBlock = state.vBlocksInFlight .front ();
69156915 int nOtherPeersWithValidatedDownloads = nPeersWithValidatedDownloads - (state.nBlocksInFlightValidHeaders > 0 );
69166916 if (nNow > state.nDownloadingSince + consensusParams.nPowTargetSpacing * (BLOCK_DOWNLOAD_TIMEOUT_BASE + BLOCK_DOWNLOAD_TIMEOUT_PER_PEER * nOtherPeersWithValidatedDownloads)) {
@@ -6924,7 +6924,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
69246924 // Message: getdata (blocks)
69256925 //
69266926 vector<CInv> vGetData;
6927- if (!pto->fDisconnect && !pto-> fClient && (fFetch || !IsInitialBlockDownload ()) && state.nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
6927+ if (!pto->fClient && (fFetch || !IsInitialBlockDownload ()) && state.nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
69286928 vector<CBlockIndex*> vToDownload;
69296929 NodeId staller = -1 ;
69306930 FindNextBlocksToDownload (pto->GetId (), MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight , vToDownload, staller, consensusParams);
@@ -6946,7 +6946,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
69466946 //
69476947 // Message: getdata (non-blocks)
69486948 //
6949- while (!pto->fDisconnect && !pto-> mapAskFor .empty () && (*pto->mapAskFor .begin ()).first <= nNow)
6949+ while (!pto->mapAskFor .empty () && (*pto->mapAskFor .begin ()).first <= nNow)
69506950 {
69516951 const CInv& inv = (*pto->mapAskFor .begin ()).second ;
69526952 if (!AlreadyHave (inv))
@@ -6972,7 +6972,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
69726972 // Message: feefilter
69736973 //
69746974 // We don't want white listed peers to filter txs to us if we have -whitelistforcerelay
6975- if (!pto-> fDisconnect && pto->nVersion >= FEEFILTER_VERSION && GetBoolArg (" -feefilter" , DEFAULT_FEEFILTER) &&
6975+ if (pto->nVersion >= FEEFILTER_VERSION && GetBoolArg (" -feefilter" , DEFAULT_FEEFILTER) &&
69766976 !(pto->fWhitelisted && GetBoolArg (" -whitelistforcerelay" , DEFAULT_WHITELISTFORCERELAY))) {
69776977 CAmount currentFilter = mempool.GetMinFee (GetArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ).GetFeePerK ();
69786978 int64_t timeNow = GetTimeMicros ();
0 commit comments