From 57c8c7c07c0dd9b96d869b21780a195a3a802001 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Thu, 1 Feb 2018 23:18:08 +0100 Subject: [PATCH] Download thread exception handling --- src/network/downloadthread.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/network/downloadthread.py b/src/network/downloadthread.py index 6da5b838..37e36398 100644 --- a/src/network/downloadthread.py +++ b/src/network/downloadthread.py @@ -55,7 +55,10 @@ class DownloadThread(threading.Thread, StoppableThread): payload.extend(addresses.encodeVarint(len(request))) for chunk in request: if chunk in Inventory(): - del i.objectsNewToMe[chunk] + try: + del i.objectsNewToMe[chunk] + except KeyError: + pass continue payload.extend(chunk) missingObjects[chunk] = now