aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2019-10-18 11:57:10 -0700
committerJonas Schnelli <dev@jonasschnelli.ch>2019-10-23 09:27:25 +0200
commit6a91499496d76c2b3e84489e9723b60514fb08db (patch)
tree4f83d328a4fe9fcab0279a96433b8c04fb577ce1 /src/net.cpp
parentb0e10ff4df3d4c70fb172ea8c3128c82e6e368bb (diff)
Remove oversized message detection from log and interface
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 210258c25a..8b9ef1d0aa 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -577,12 +577,6 @@ bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes, bool& complete
return false;
}
- if (m_deserializer->OversizedMessageDetected()) {
- LogPrint(BCLog::NET, "Oversized message from peer=%i, disconnecting\n", GetId());
- m_deserializer->Reset();
- return false;
- }
-
pch += handled;
nBytes -= handled;
@@ -655,9 +649,10 @@ int V1TransportDeserializer::readHeader(const char *pch, unsigned int nBytes)
return -1;
}
- // reject messages larger than MAX_SIZE
- if (hdr.nMessageSize > MAX_SIZE)
+ // reject messages larger than MAX_SIZE or MAX_PROTOCOL_MESSAGE_LENGTH
+ if (hdr.nMessageSize > MAX_SIZE || hdr.nMessageSize > MAX_PROTOCOL_MESSAGE_LENGTH) {
return -1;
+ }
// switch state to reading message data
in_data = true;