diff --git a/src/net.cpp b/src/net.cpp index e7c7cf011..3478d04a7 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1859,7 +1859,7 @@ void CConnman::ThreadMessageHandler() if (pnode->nSendSize < GetSendBufferSize()) { - if (!pnode->vRecvGetData.empty() || (!pnode->vRecvMsg.empty() && pnode->vRecvMsg[0].complete())) + if (!pnode->vRecvGetData.empty() || (!pnode->vRecvMsg.empty() && pnode->vRecvMsg.front().complete())) { fSleep = false; } diff --git a/src/net.h b/src/net.h index 6ca402f71..f346b0735 100644 --- a/src/net.h +++ b/src/net.h @@ -605,7 +605,7 @@ public: CCriticalSection cs_vSend; std::deque vRecvGetData; - std::deque vRecvMsg; + std::list vRecvMsg; CCriticalSection cs_vRecvMsg; uint64_t nRecvBytes; int nRecvVersion; diff --git a/src/net_processing.cpp b/src/net_processing.cpp index ccfbb77fc..f53a4b263 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2471,7 +2471,7 @@ bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic& interru // this maintains the order of responses if (!pfrom->vRecvGetData.empty()) return fOk; - std::deque::iterator it = pfrom->vRecvMsg.begin(); + auto it = pfrom->vRecvMsg.begin(); while (!pfrom->fDisconnect && it != pfrom->vRecvMsg.end()) { // Don't bother if send buffer is too full to respond anyway if (pfrom->nSendSize >= nMaxSendBufferSize)