From f30149ad49f220da4639d897586345e7def531e4 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 13 Dec 2015 06:33:06 +0100 Subject: [PATCH] fix #1579 --- lib/blockchain.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/blockchain.py b/lib/blockchain.py index d8cd42d6b..2f6a090e8 100644 --- a/lib/blockchain.py +++ b/lib/blockchain.py @@ -56,8 +56,7 @@ class Blockchain(util.PrintError): self.verify_header(header, prev_header, bits, target) prev_header = header - def verify_chunk(self, index, hexdata): - data = hexdata.decode('hex') + def verify_chunk(self, index, data): num = len(data) / 80 prev_header = None if index != 0: @@ -212,11 +211,12 @@ class Blockchain(util.PrintError): self.print_error(str(e)) return False - def connect_chunk(self, idx, chunk): + def connect_chunk(self, idx, hexdata): try: - self.verify_chunk(idx, chunk) - self.print_error("validated chunk %d" % index) - self.save_chunk(index, data) + data = hexdata.decode('hex') + self.verify_chunk(idx, data) + self.print_error("validated chunk %d" % idx) + self.save_chunk(idx, data) return idx + 1 except BaseException as e: self.print_error('verify_chunk failed', str(e))