Ignore invalid updatePiecefields response
This commit is contained in:
parent
2f3b3ebf2b
commit
7ba3d86af4
1 changed files with 6 additions and 2 deletions
|
@ -9,6 +9,7 @@ import math
|
||||||
import msgpack
|
import msgpack
|
||||||
|
|
||||||
from Plugin import PluginManager
|
from Plugin import PluginManager
|
||||||
|
from Debug import Debug
|
||||||
from Crypt import CryptHash
|
from Crypt import CryptHash
|
||||||
from lib import merkletools
|
from lib import merkletools
|
||||||
from util import helper
|
from util import helper
|
||||||
|
@ -602,8 +603,11 @@ class PeerPlugin(object):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.piecefields = collections.defaultdict(BigfilePiecefieldPacked)
|
self.piecefields = collections.defaultdict(BigfilePiecefieldPacked)
|
||||||
for sha512, piecefield_packed in res["piecefields_packed"].iteritems():
|
try:
|
||||||
self.piecefields[sha512].unpack(piecefield_packed)
|
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
|
return self.piecefields
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue