refactor: make Transport::ReceivedBytes just return success/fail

This commit is contained in:
Pieter Wuille
2023-07-29 13:59:35 -04:00
parent bb4aab90fd
commit 8a3b6f3387
3 changed files with 21 additions and 10 deletions

View File

@@ -690,9 +690,8 @@ bool CNode::ReceiveMsgBytes(Span<const uint8_t> msg_bytes, bool& complete)
nRecvBytes += msg_bytes.size();
while (msg_bytes.size() > 0) {
// absorb network data
int handled = m_transport->ReceivedBytes(msg_bytes);
if (handled < 0) {
// Serious header problem, disconnect from the peer.
if (!m_transport->ReceivedBytes(msg_bytes)) {
// Serious transport problem, disconnect from the peer.
return false;
}