commit 94f7a87e4773f605a8ad9e72c1d96c882ec6c05d
parent 810f107229cbc12d76cbe80348cc8500f28f17f5
Author: ThomasV <thomasv@electrum.org>
Date: Tue, 25 Jul 2017 18:57:34 +0200
remove dead code
Diffstat:
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/lib/blockchain.py b/lib/blockchain.py
@@ -159,15 +159,6 @@ class Blockchain(util.PrintError):
if int('0x' + _hash, 16) > target:
raise BaseException("insufficient proof of work: %s vs target %s" % (int('0x' + _hash, 16), target))
- def verify_chain(self, chain):
- first_header = chain[0]
- prev_header = self.read_header(first_header.get('block_height') - 1)
- for header in chain:
- height = header.get('block_height')
- bits, target = self.get_target(height / 2016, chain)
- self.verify_header(header, prev_header, bits, target)
- prev_header = header
-
def verify_chunk(self, index, data):
num = len(data) / 80
prev_header = None
@@ -275,18 +266,13 @@ class Blockchain(util.PrintError):
h = self.local_height
return sum([self.BIP9(h-i, 2) for i in range(N)])*10000/N/100.
- def get_target(self, index, chain=None):
+ def get_target(self, index):
if bitcoin.TESTNET:
return 0, 0
if index == 0:
return 0x1d00ffff, MAX_TARGET
first = self.read_header((index-1) * 2016)
last = self.read_header(index*2016 - 1)
- if last is None:
- for h in chain:
- if h.get('block_height') == index*2016 - 1:
- last = h
- assert last is not None
# bits to target
bits = last.get('bits')
bitsN = (bits >> 24) & 0xff