|
|
@ -2468,21 +2468,16 @@ bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic<bool>& interru |
|
|
|
if (pfrom->nSendSize >= nMaxSendBufferSize) |
|
|
|
if (pfrom->nSendSize >= nMaxSendBufferSize) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
auto it = pfrom->vRecvMsg.begin(); |
|
|
|
std::list<CNetMessage> msgs; |
|
|
|
if (it == pfrom->vRecvMsg.end()) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
LOCK(pfrom->cs_vProcessMsg); |
|
|
|
|
|
|
|
if (pfrom->vProcessMsg.empty()) |
|
|
|
// end, if an incomplete message is found
|
|
|
|
|
|
|
|
if (!it->complete()) |
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
// Just take one message
|
|
|
|
// get next message
|
|
|
|
msgs.splice(msgs.begin(), pfrom->vProcessMsg, pfrom->vProcessMsg.begin()); |
|
|
|
CNetMessage msg = std::move(*it); |
|
|
|
fMoreWork = !pfrom->vProcessMsg.empty(); |
|
|
|
|
|
|
|
} |
|
|
|
// at this point, any failure means we can delete the current message
|
|
|
|
CNetMessage& msg(msgs.front()); |
|
|
|
pfrom->vRecvMsg.erase(pfrom->vRecvMsg.begin()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fMoreWork = !pfrom->vRecvMsg.empty() && pfrom->vRecvMsg.front().complete(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.SetVersion(pfrom->GetRecvVersion()); |
|
|
|
msg.SetVersion(pfrom->GetRecvVersion()); |
|
|
|
// Scan for message start
|
|
|
|
// Scan for message start
|
|
|
|