Fixed: ERROR - Too many items in inv message! Closes 1274

python3android
coffeedogs 6 years ago
parent 1f6a7adf03
commit 02f40f5036
No known key found for this signature in database
GPG Key ID: 9D818C503D0B7E70

@ -300,7 +300,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
def _command_inv(self, dandelion=False):
items = self.decode_payload_content("l32s")
if len(items) >= BMProto.maxObjectCount:
if len(items) > BMProto.maxObjectCount:
logger.error("Too many items in %sinv message!", "d" if dandelion else "")
raise BMProtoExcessiveDataError()
else:

@ -180,7 +180,11 @@ class TCPConnection(BMProto, TLSDispatcher):
for hash, storedValue in bigInvList.items():
payload += hash
objectCount += 1
if objectCount >= BMProto.maxObjectCount:
# Remove -1 below when sufficient time has passed for users to
# upgrade to versions of PyBitmessage that accept inv with 50,000
# items
if objectCount >= BMProto.maxObjectCount - 1:
sendChunk()
payload = b''
objectCount = 0

Loading…
Cancel
Save