Make resetting implicit in TransportDeserializer::Read()

This commit is contained in:
Pieter Wuille
2019-10-18 12:03:13 -07:00
committed by Jonas Schnelli
parent 6a91499496
commit f342a5e61a
2 changed files with 11 additions and 12 deletions

View File

@@ -572,10 +572,7 @@ bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes, bool& complete
while (nBytes > 0) {
// absorb network data
int handled = m_deserializer->Read(pch, nBytes);
if (handled < 0) {
m_deserializer->Reset();
return false;
}
if (handled < 0) return false;
pch += handled;
nBytes -= handled;