ignore blocks marked as BLOCK_FAILED_VALID and BLOCK_FAILED_CHILD

This commit is contained in:
Victor Shyba 2020-10-21 14:57:35 -03:00 committed by Jeremy Kauffman
parent daed032bb7
commit c1aa9b8150

View file

@ -117,7 +117,7 @@ class BlockchainDB:
MAX(height) as best_height, MAX(height) as best_height,
MIN(height) as start_height MIN(height) as start_height
FROM block_info FROM block_info
WHERE status&1 AND status&4 WHERE status&1 AND status&4 AND NOT status&32 AND NOT status&64
""" """
args = () args = ()
if file_number is not None and start_height is not None: if file_number is not None and start_height is not None:
@ -135,7 +135,8 @@ class BlockchainDB:
""" """
SELECT datapos as data_offset, height, hash as block_hash, txCount as txs SELECT datapos as data_offset, height, hash as block_hash, txCount as txs
FROM block_info FROM block_info
WHERE file = ? AND height >= ? AND status&1 AND status&4 WHERE file = ? AND height >= ?
AND status&1 AND status&4 AND NOT status&32 AND NOT status&64
ORDER BY datapos ASC; ORDER BY datapos ASC;
""", (block_file, start_height) """, (block_file, start_height)
)] )]