New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move cs_vSend into SocketSendData and resolve RecordBytesSent lock inconsistency #19673
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -759,8 +759,8 @@ 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 | ||||||
size_t nSendSize GUARDED_BY(cs_vSend){0}; // total size of all vSendMsg entries | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit, clang-format suggests:
Suggested change
|
||||||
size_t nSendOffset GUARDED_BY(cs_vSend){0}; // offset inside the first vSendMsg already sent | ||||||
uint64_t nSendBytes GUARDED_BY(cs_vSend){0}; | ||||||
std::deque<std::vector<unsigned char>> vSendMsg GUARDED_BY(cs_vSend); | ||||||
RecursiveMutex cs_vSend; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this could use a comment. Something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||
|
@@ -817,7 +817,7 @@ class CNode | |||||
std::atomic_bool fPauseSend{false}; | ||||||
|
||||||
protected: | ||||||
mapMsgCmdSize mapSendBytesPerMsgCmd; | ||||||
mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend); | ||||||
troygiorshev marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv); | ||||||
|
||||||
public: | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you retouch the branch, you may as well touch every line in this function: