diff --git a/electrum/blockchain.py b/electrum/blockchain.py index 1a63535bf..cd2cdb4a1 100644 --- a/electrum/blockchain.py +++ b/electrum/blockchain.py @@ -221,10 +221,10 @@ class Blockchain(util.PrintError): raise Exception("prev hash mismatch: %s vs %s" % (prev_hash, header.get('prev_block_hash'))) if constants.net.TESTNET: return - if bits != header.get('bits'): - raise Exception("bits mismatch: %s vs %s" % (bits, header.get('bits'))) - if int('0x' + _hash, 16) > target: - raise Exception("insufficient proof of work: %s vs target %s" % (int('0x' + _hash, 16), target)) + #if bits != header.get('bits'): + # raise Exception("bits mismatch: %s vs %s" % (bits, header.get('bits'))) + #if int('0x' + _hash, 16) > target: + # raise Exception("insufficient proof of work: %s vs target %s" % (int('0x' + _hash, 16), target)) def verify_chunk(self, index: int, data: bytes) -> None: num = len(data) // HEADER_SIZE @@ -428,7 +428,7 @@ class Blockchain(util.PrintError): return GENESIS_BITS, MAX_TARGET if index == 0: return GENESIS_BITS, MAX_TARGET - first = self.read_header(index) + first = self.read_header(index-1) assert last is not None, "Last shouldn't be none" # bits to target bits = last.get('bits')