replace header_hashes with header_prevhash , header_hash

This commit is contained in:
TheLazieR Yip 2016-11-25 07:15:18 -05:00
parent 6b63ecb439
commit b3623f5455

View File

@ -568,7 +568,7 @@ class BlockProcessor(server.db.DB):
# the UTXO cache uses the FS cache via get_tx_hash() to # the UTXO cache uses the FS cache via get_tx_hash() to
# resolve compressed key collisions # resolve compressed key collisions
header, tx_hashes, txs = self.coin.read_block(block) header, tx_hashes, txs = self.coin.read_block(block)
prev_hash, header_hash = self.coin.header_hashes(header) prev_hash, header_hash = self.coin.header_prevhash(header), self.coin.header_hash(header)
if prev_hash != self.tip: if prev_hash != self.tip:
raise ChainReorg raise ChainReorg
@ -636,7 +636,7 @@ class BlockProcessor(server.db.DB):
touched = set() touched = set()
for block in blocks: for block in blocks:
header, tx_hashes, txs = self.coin.read_block(block) header, tx_hashes, txs = self.coin.read_block(block)
prev_hash, header_hash = self.coin.header_hashes(header) prev_hash, header_hash = self.coin.header_prevhash(header), self.coin.header_hash(header)
if header_hash != self.tip: if header_hash != self.tip:
raise ChainError('backup block {} is not tip {} at height {:,d}' raise ChainError('backup block {} is not tip {} at height {:,d}'
.format(hash_to_str(header_hash), .format(hash_to_str(header_hash),