@@ -6527,7 +6527,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
6527
6527
// Ping automatically sent as a latency probe & keepalive.
6528
6528
pingSend = true ;
6529
6529
}
6530
- if (pingSend && !pto-> fDisconnect ) {
6530
+ if (pingSend) {
6531
6531
uint64_t nonce = 0 ;
6532
6532
while (nonce == 0 ) {
6533
6533
GetRandBytes ((unsigned char *)&nonce, sizeof (nonce));
@@ -6610,7 +6610,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
6610
6610
if (pindexBestHeader == NULL )
6611
6611
pindexBestHeader = chainActive.Tip ();
6612
6612
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 ) {
6614
6614
// Only actively request headers from a single peer, unless we're close to today.
6615
6615
if ((nSyncStarted == 0 && fFetch ) || pindexBestHeader->GetBlockTime () > GetAdjustedTime () - 24 * 60 * 60 ) {
6616
6616
state.fSyncStarted = true ;
@@ -6897,7 +6897,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
6897
6897
6898
6898
// Detect whether we're stalling
6899
6899
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) {
6901
6901
// Stalling only triggers when the block download window cannot move. During normal steady state,
6902
6902
// the download window should be much larger than the to-be-downloaded set of blocks, so disconnection
6903
6903
// should only happen during initial block download.
@@ -6910,7 +6910,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
6910
6910
// We compensate for other peers to prevent killing off peers due to our own downstream link
6911
6911
// being saturated. We only count validated in-flight blocks so peers can't advertise non-existing block hashes
6912
6912
// to unreasonably increase our timeout.
6913
- if (!pto-> fDisconnect && state.vBlocksInFlight .size () > 0 ) {
6913
+ if (state.vBlocksInFlight .size () > 0 ) {
6914
6914
QueuedBlock &queuedBlock = state.vBlocksInFlight .front ();
6915
6915
int nOtherPeersWithValidatedDownloads = nPeersWithValidatedDownloads - (state.nBlocksInFlightValidHeaders > 0 );
6916
6916
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)
6924
6924
// Message: getdata (blocks)
6925
6925
//
6926
6926
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) {
6928
6928
vector<CBlockIndex*> vToDownload;
6929
6929
NodeId staller = -1 ;
6930
6930
FindNextBlocksToDownload (pto->GetId (), MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight , vToDownload, staller, consensusParams);
@@ -6946,7 +6946,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
6946
6946
//
6947
6947
// Message: getdata (non-blocks)
6948
6948
//
6949
- while (!pto->fDisconnect && !pto-> mapAskFor .empty () && (*pto->mapAskFor .begin ()).first <= nNow)
6949
+ while (!pto->mapAskFor .empty () && (*pto->mapAskFor .begin ()).first <= nNow)
6950
6950
{
6951
6951
const CInv& inv = (*pto->mapAskFor .begin ()).second ;
6952
6952
if (!AlreadyHave (inv))
@@ -6972,7 +6972,7 @@ bool SendMessages(CNode* pto, CConnman& connman)
6972
6972
// Message: feefilter
6973
6973
//
6974
6974
// 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) &&
6976
6976
!(pto->fWhitelisted && GetBoolArg (" -whitelistforcerelay" , DEFAULT_WHITELISTFORCERELAY))) {
6977
6977
CAmount currentFilter = mempool.GetMinFee (GetArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ).GetFeePerK ();
6978
6978
int64_t timeNow = GetTimeMicros ();
0 commit comments