net: use std::deque for vSendMsg instead of std::list

The change was introduced as an optimization in 027a852a (dash#3398) but
prevents the backport of bitcoin#26844 due to the inability to engage in
binary expressions with iterators of `std::list`.
This commit is contained in:
Kittywhiskers Van Gogh 2024-06-16 11:55:00 +00:00
parent 2ecba6ba5f
commit caaa0fda01
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -471,7 +471,7 @@ public:
/** Offset inside the first vSendMsg already sent */ /** Offset inside the first vSendMsg already sent */
size_t nSendOffset GUARDED_BY(cs_vSend){0}; size_t nSendOffset GUARDED_BY(cs_vSend){0};
uint64_t nSendBytes GUARDED_BY(cs_vSend){0}; uint64_t nSendBytes GUARDED_BY(cs_vSend){0};
std::list<std::vector<unsigned char>> vSendMsg GUARDED_BY(cs_vSend); std::deque<std::vector<unsigned char>> vSendMsg GUARDED_BY(cs_vSend);
std::atomic<size_t> nSendMsgSize{0}; std::atomic<size_t> nSendMsgSize{0};
Mutex cs_vSend; Mutex cs_vSend;
Mutex m_sock_mutex; Mutex m_sock_mutex;