From a9c0000c17bdd2b46930c3cfe20032f7aaee8896 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sat, 3 Jun 2017 16:29:21 +0200 Subject: [PATCH] Treat some invalid objects as received - update to 6044df5adf84b767e559b482ab90aead7eb1c4ab - objects that are expired or in wrong stream are not re-requested anymore, even if they aren't stored in the inventory - the previous option "acceptmismatch" now only affects whether such objects are stored in the inventory --- src/network/bmproto.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/network/bmproto.py b/src/network/bmproto.py index 722438f5..e85da3f2 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -278,12 +278,17 @@ class BMProto(AdvancedDispatcher, ObjectTracker): self.object.checkProofOfWorkSufficient() try: self.object.checkEOLSanity() - except BMObjectExpiredError: - if not BMConfigParser().get("inventory", "acceptmismatch"): - raise - try: self.object.checkStream() - except BMObjectUnwantedStreamError: + except (BMObjectExpiredError, BMObjectUnwantedStreamError): + for connection in BMConnectionPool().inboundConnections.values() + BMConnectionPool().outboundConnections.values(): + try: + del connection.objectsNewtoThem[hashId] + except KeyError: + pass + try: + del connection.objectsNewToMe[hashId] + except KeyError: + pass if not BMConfigParser().get("inventory", "acceptmismatch"): raise self.object.checkAlreadyHave()