@@ -515,10 +515,10 @@ struct Peer {
515
515
/* * Set of txids to reconsider once their parent transactions have been accepted **/
516
516
std::set<uint256> m_orphan_work_set GUARDED_BY (g_cs_orphans);
517
517
518
- /* * Protects vRecvGetData **/
518
+ /* * Protects m_getdata_requests **/
519
519
Mutex m_getdata_requests_mutex;
520
520
/* * Work queue of items requested by this peer **/
521
- std::deque<CInv> vRecvGetData GUARDED_BY (m_getdata_requests_mutex);
521
+ std::deque<CInv> m_getdata_requests GUARDED_BY (m_getdata_requests_mutex);
522
522
523
523
Peer (NodeId id) : m_id(id) {}
524
524
};
@@ -1759,7 +1759,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa
1759
1759
{
1760
1760
AssertLockNotHeld (cs_main);
1761
1761
1762
- std::deque<CInv>::iterator it = peer.vRecvGetData .begin ();
1762
+ std::deque<CInv>::iterator it = peer.m_getdata_requests .begin ();
1763
1763
std::vector<CInv> vNotFound;
1764
1764
const CNetMsgMaker msgMaker (pfrom.GetCommonVersion ());
1765
1765
@@ -1771,7 +1771,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa
1771
1771
// Process as many TX items from the front of the getdata queue as
1772
1772
// possible, since they're common and it's efficient to batch process
1773
1773
// them.
1774
- while (it != peer.vRecvGetData .end () && it->IsGenTxMsg ()) {
1774
+ while (it != peer.m_getdata_requests .end () && it->IsGenTxMsg ()) {
1775
1775
if (interruptMsgProc) return ;
1776
1776
// The send buffer provides backpressure. If there's no space in
1777
1777
// the buffer, pause processing until the next call.
@@ -1819,7 +1819,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa
1819
1819
1820
1820
// Only process one BLOCK item per call, since they're uncommon and can be
1821
1821
// expensive to process.
1822
- if (it != peer.vRecvGetData .end () && !pfrom.fPauseSend ) {
1822
+ if (it != peer.m_getdata_requests .end () && !pfrom.fPauseSend ) {
1823
1823
const CInv &inv = *it++;
1824
1824
if (inv.IsGenBlkMsg ()) {
1825
1825
ProcessGetBlockData (pfrom, chainparams, inv, connman);
@@ -1828,7 +1828,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa
1828
1828
// and continue processing the queue on the next call.
1829
1829
}
1830
1830
1831
- peer.vRecvGetData .erase (peer.vRecvGetData .begin (), it);
1831
+ peer.m_getdata_requests .erase (peer.m_getdata_requests .begin (), it);
1832
1832
1833
1833
if (!vNotFound.empty ()) {
1834
1834
// 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
2812
2812
2813
2813
{
2814
2814
LOCK (peer->m_getdata_requests_mutex );
2815
- peer->vRecvGetData .insert (peer->vRecvGetData .end (), vInv.begin (), vInv.end ());
2815
+ peer->m_getdata_requests .insert (peer->m_getdata_requests .end (), vInv.begin (), vInv.end ());
2816
2816
ProcessGetData (pfrom, *peer, m_chainparams, m_connman, m_mempool, interruptMsgProc);
2817
2817
}
2818
2818
@@ -2933,7 +2933,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2933
2933
CInv inv;
2934
2934
WITH_LOCK (cs_main, inv.type = State (pfrom.GetId ())->fWantsCmpctWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK);
2935
2935
inv.hash = req.blockhash ;
2936
- WITH_LOCK (peer->m_getdata_requests_mutex , peer->vRecvGetData .push_back (inv));
2936
+ WITH_LOCK (peer->m_getdata_requests_mutex , peer->m_getdata_requests .push_back (inv));
2937
2937
// The message processing loop will go around again (without pausing) and we'll respond then
2938
2938
return ;
2939
2939
}
@@ -3886,7 +3886,7 @@ bool PeerManager::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgP
3886
3886
3887
3887
{
3888
3888
LOCK (peer->m_getdata_requests_mutex );
3889
- if (!peer->vRecvGetData .empty ()) {
3889
+ if (!peer->m_getdata_requests .empty ()) {
3890
3890
ProcessGetData (*pfrom, *peer, m_chainparams, m_connman, m_mempool, interruptMsgProc);
3891
3891
}
3892
3892
}
@@ -3902,10 +3902,10 @@ bool PeerManager::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgP
3902
3902
return false ;
3903
3903
3904
3904
// this maintains the order of responses
3905
- // and prevents vRecvGetData to grow unbounded
3905
+ // and prevents m_getdata_requests to grow unbounded
3906
3906
{
3907
3907
LOCK (peer->m_getdata_requests_mutex );
3908
- if (!peer->vRecvGetData .empty ()) return true ;
3908
+ if (!peer->m_getdata_requests .empty ()) return true ;
3909
3909
}
3910
3910
3911
3911
{
@@ -3941,7 +3941,7 @@ bool PeerManager::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgP
3941
3941
if (interruptMsgProc) return false ;
3942
3942
{
3943
3943
LOCK (peer->m_getdata_requests_mutex );
3944
- if (!peer->vRecvGetData .empty ()) fMoreWork = true ;
3944
+ if (!peer->m_getdata_requests .empty ()) fMoreWork = true ;
3945
3945
}
3946
3946
} catch (const std::exception& e) {
3947
3947
LogPrint (BCLog::NET, " %s(%s, %u bytes): Exception '%s' (%s) caught\n " , __func__, SanitizeString (msg_type), nMessageSize, e.what (), typeid (e).name ());
0 commit comments