Skip to content

Commit

Permalink
[net] Add cs_vSend lock annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewbery committed Jan 2, 2021
1 parent 6732545 commit 378aedc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/net.h
Expand Up @@ -857,8 +857,10 @@ class CNode
// socket
std::atomic<ServiceFlags> nServices{NODE_NONE};
SOCKET hSocket GUARDED_BY(cs_hSocket);
size_t nSendSize{0}; // total size of all vSendMsg entries
size_t nSendOffset{0}; // offset inside the first vSendMsg already sent
/** Total size of all vSendMsg entries */
size_t nSendSize GUARDED_BY(cs_vSend){0};
/** Offset inside the first vSendMsg already sent */
size_t nSendOffset GUARDED_BY(cs_vSend){0};
uint64_t nSendBytes GUARDED_BY(cs_vSend){0};
std::deque<std::vector<unsigned char>> vSendMsg GUARDED_BY(cs_vSend);
RecursiveMutex cs_vSend;
Expand Down Expand Up @@ -989,7 +991,7 @@ class CNode
Network ConnectedThroughNetwork() const;

protected:
mapMsgCmdSize mapSendBytesPerMsgCmd;
mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend);
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv);

public:
Expand Down

0 comments on commit 378aedc

Please sign in to comment.