mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
net: remove cs_vRecvMsg
vRecvMsg is now only touched by the socket handler thread. The accounting vars (nRecvBytes/nLastRecv/mapRecvBytesPerMsgCmd) are also only used by the socket handler thread, with the exception of queries from rpc/gui. These accesses are not threadsafe, but they never were. This needs to be addressed separately. Also, update comment describing data flow
This commit is contained in:
@@ -613,8 +613,6 @@ public:
|
||||
size_t nProcessQueueSize;
|
||||
|
||||
std::deque<CInv> vRecvGetData;
|
||||
std::list<CNetMessage> vRecvMsg;
|
||||
CCriticalSection cs_vRecvMsg;
|
||||
uint64_t nRecvBytes;
|
||||
std::atomic<int> nRecvVersion;
|
||||
|
||||
@@ -726,6 +724,7 @@ private:
|
||||
const ServiceFlags nLocalServices;
|
||||
const int nMyStartingHeight;
|
||||
int nSendVersion;
|
||||
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
|
||||
public:
|
||||
|
||||
NodeId GetId() const {
|
||||
@@ -746,7 +745,6 @@ public:
|
||||
return nRefCount;
|
||||
}
|
||||
|
||||
// requires LOCK(cs_vRecvMsg)
|
||||
bool ReceiveMsgBytes(const char *pch, unsigned int nBytes, bool& complete);
|
||||
|
||||
void SetRecvVersion(int nVersionIn)
|
||||
|
||||
Reference in New Issue
Block a user