diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2020-07-17 14:56:34 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2020-08-07 17:18:12 -0700 |
commit | 3f1b7140e95d0f8f958cb35f31c3d964c57e484d (patch) | |
tree | d426deed3b73e6a90d338dc08221ec45934a5533 /src/net_processing.cpp | |
parent | a41ae68053387567414021228995a485e29ad611 (diff) |
scripted-diff: Rename OneShot to AddrFetch
-BEGIN VERIFY SCRIPT-
sed -i 's/a oneshot/an addrfetch/g' src/chainparams.cpp #comment
sed -i 's/oneshot/addrfetch/g' src/net.cpp #comment
sed -i 's/AddOneShot/AddAddrFetch/g' src/net.h src/net.cpp
sed -i 's/cs_vOneShots/m_addr_fetches_mutex/g' src/net.h src/net.cpp
sed -i 's/vOneShots/m_addr_fetches/g' src/net.h src/net.cpp
sed -i 's/fOneShot/m_addr_fetch/g' src/net.h src/net.cpp src/net_processing.cpp
sed -i 's/ProcessOneShot/ProcessAddrFetch/g' src/net.h src/net.cpp
-END VERIFY SCRIPT-
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index ca701a7e5b..ba30f7a7b6 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -473,7 +473,7 @@ static void UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUS nPreferredDownload -= state->fPreferredDownload; // Whether this node should be marked as a preferred download node. - state->fPreferredDownload = (!node.fInbound || node.HasPermission(PF_NOBAN)) && !node.fOneShot && !node.fClient; + state->fPreferredDownload = (!node.fInbound || node.HasPermission(PF_NOBAN)) && !node.m_addr_fetch && !node.fClient; nPreferredDownload += state->fPreferredDownload; } @@ -831,7 +831,7 @@ void UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds) // one-shots. static bool IsOutboundDisconnectionCandidate(const CNode& node) { - return !(node.fInbound || node.m_manual_connection || node.fFeeler || node.fOneShot); + return !(node.fInbound || node.m_manual_connection || node.fFeeler || node.m_addr_fetch); } void PeerLogicValidation::InitializeNode(CNode *pnode) { @@ -2584,7 +2584,7 @@ void ProcessMessage( connman.AddNewAddresses(vAddrOk, pfrom.addr, 2 * 60 * 60); if (vAddr.size() < 1000) pfrom.fGetAddr = false; - if (pfrom.fOneShot) + if (pfrom.m_addr_fetch) pfrom.fDisconnect = true; return; } @@ -4097,7 +4097,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto) // Start block sync if (pindexBestHeader == nullptr) pindexBestHeader = ::ChainActive().Tip(); - 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. + bool fFetch = state.fPreferredDownload || (nPreferredDownload == 0 && !pto->fClient && !pto->m_addr_fetch); // Download if this is a nice peer, or we have no nice peers and this one might do. if (!state.fSyncStarted && !pto->fClient && !fImporting && !fReindex) { // Only actively request headers from a single peer, unless we're close to today. if ((nSyncStarted == 0 && fFetch) || pindexBestHeader->GetBlockTime() > GetAdjustedTime() - 24 * 60 * 60) { |