diff options
author | Neha Narula <narula@gmail.com> | 2020-09-30 14:23:28 -0400 |
---|---|---|
committer | Neha Narula <narula@gmail.com> | 2020-10-14 10:08:44 -0400 |
commit | da0988daf1d665a4644ad3f1ddf3f8a8bdd88cde (patch) | |
tree | ea731c8943fa94fc4092757b1234af51b8d91d8f | |
parent | ba951812ec0cc8ebee5911a582f188525b76ff0a (diff) | |
download | bitcoin-da0988daf1d665a4644ad3f1ddf3f8a8bdd88cde.tar.xz |
scripted-diff: rename vRecvGetData
-BEGIN VERIFY SCRIPT-
sed -i 's/vRecvGetData/m_getdata_requests/g' src/net_processing.cpp
-END VERIFY SCRIPT-
-rw-r--r-- | src/net_processing.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 162d484566..83bea58fe9 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -515,10 +515,10 @@ struct Peer { /** Set of txids to reconsider once their parent transactions have been accepted **/ std::set<uint256> m_orphan_work_set GUARDED_BY(g_cs_orphans); - /** Protects vRecvGetData **/ + /** Protects m_getdata_requests **/ Mutex m_getdata_requests_mutex; /** Work queue of items requested by this peer **/ - std::deque<CInv> vRecvGetData GUARDED_BY(m_getdata_requests_mutex); + std::deque<CInv> m_getdata_requests GUARDED_BY(m_getdata_requests_mutex); Peer(NodeId id) : m_id(id) {} }; @@ -1759,7 +1759,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa { AssertLockNotHeld(cs_main); - std::deque<CInv>::iterator it = peer.vRecvGetData.begin(); + std::deque<CInv>::iterator it = peer.m_getdata_requests.begin(); std::vector<CInv> vNotFound; const CNetMsgMaker msgMaker(pfrom.GetCommonVersion()); @@ -1771,7 +1771,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa // Process as many TX items from the front of the getdata queue as // possible, since they're common and it's efficient to batch process // them. - while (it != peer.vRecvGetData.end() && it->IsGenTxMsg()) { + while (it != peer.m_getdata_requests.end() && it->IsGenTxMsg()) { if (interruptMsgProc) return; // The send buffer provides backpressure. If there's no space in // the buffer, pause processing until the next call. @@ -1819,7 +1819,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa // Only process one BLOCK item per call, since they're uncommon and can be // expensive to process. - if (it != peer.vRecvGetData.end() && !pfrom.fPauseSend) { + if (it != peer.m_getdata_requests.end() && !pfrom.fPauseSend) { const CInv &inv = *it++; if (inv.IsGenBlkMsg()) { ProcessGetBlockData(pfrom, chainparams, inv, connman); @@ -1828,7 +1828,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa // and continue processing the queue on the next call. } - peer.vRecvGetData.erase(peer.vRecvGetData.begin(), it); + peer.m_getdata_requests.erase(peer.m_getdata_requests.begin(), it); if (!vNotFound.empty()) { // Let the peer know that we didn't find what it asked for, so it doesn't @@ -2812,7 +2812,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat { LOCK(peer->m_getdata_requests_mutex); - peer->vRecvGetData.insert(peer->vRecvGetData.end(), vInv.begin(), vInv.end()); + peer->m_getdata_requests.insert(peer->m_getdata_requests.end(), vInv.begin(), vInv.end()); ProcessGetData(pfrom, *peer, m_chainparams, m_connman, m_mempool, interruptMsgProc); } @@ -2933,7 +2933,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat CInv inv; WITH_LOCK(cs_main, inv.type = State(pfrom.GetId())->fWantsCmpctWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK); inv.hash = req.blockhash; - WITH_LOCK(peer->m_getdata_requests_mutex, peer->vRecvGetData.push_back(inv)); + WITH_LOCK(peer->m_getdata_requests_mutex, peer->m_getdata_requests.push_back(inv)); // The message processing loop will go around again (without pausing) and we'll respond then return; } @@ -3886,7 +3886,7 @@ bool PeerManager::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgP { LOCK(peer->m_getdata_requests_mutex); - if (!peer->vRecvGetData.empty()) { + if (!peer->m_getdata_requests.empty()) { ProcessGetData(*pfrom, *peer, m_chainparams, m_connman, m_mempool, interruptMsgProc); } } @@ -3902,10 +3902,10 @@ bool PeerManager::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgP return false; // this maintains the order of responses - // and prevents vRecvGetData to grow unbounded + // and prevents m_getdata_requests to grow unbounded { LOCK(peer->m_getdata_requests_mutex); - if (!peer->vRecvGetData.empty()) return true; + if (!peer->m_getdata_requests.empty()) return true; } { @@ -3941,7 +3941,7 @@ bool PeerManager::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgP if (interruptMsgProc) return false; { LOCK(peer->m_getdata_requests_mutex); - if (!peer->vRecvGetData.empty()) fMoreWork = true; + if (!peer->m_getdata_requests.empty()) fMoreWork = true; } } catch (const std::exception& e) { LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' (%s) caught\n", __func__, SanitizeString(msg_type), nMessageSize, e.what(), typeid(e).name()); |