Ignore invalid updatePiecefields response

This commit is contained in:
shortcutme 2017-10-10 14:58:13 +02:00
parent 2f3b3ebf2b
commit 7ba3d86af4
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -9,6 +9,7 @@ import math
import msgpack
from Plugin import PluginManager
from Debug import Debug
from Crypt import CryptHash
from lib import merkletools
from util import helper
@ -602,8 +603,11 @@ class PeerPlugin(object):
return False
self.piecefields = collections.defaultdict(BigfilePiecefieldPacked)
try:
for sha512, piecefield_packed in res["piecefields_packed"].iteritems():
self.piecefields[sha512].unpack(piecefield_packed)
except Exception as err:
self.log("Invalid updatePiecefields response: %s" % Debug.formatException(err))
return self.piecefields