Skip to content

Commit

Permalink
Treat some invalid objects as received
Browse files Browse the repository at this point in the history
- update to 6044df5
- 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
  • Loading branch information
PeterSurda committed Jun 3, 2017
1 parent f78f1a7 commit a9c0000
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/network/bmproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,17 @@ def bm_command_object(self):
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()
Expand Down

0 comments on commit a9c0000

Please sign in to comment.