Download thread exception handling

This commit is contained in:
Peter Šurda 2018-02-01 23:18:08 +01:00
parent 8498143783
commit 57c8c7c07c
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -55,7 +55,10 @@ class DownloadThread(threading.Thread, StoppableThread):
payload.extend(addresses.encodeVarint(len(request))) payload.extend(addresses.encodeVarint(len(request)))
for chunk in request: for chunk in request:
if chunk in Inventory(): if chunk in Inventory():
del i.objectsNewToMe[chunk] try:
del i.objectsNewToMe[chunk]
except KeyError:
pass
continue continue
payload.extend(chunk) payload.extend(chunk)
missingObjects[chunk] = now missingObjects[chunk] = now