From c1aa9b8150a43c3889a3271995ebfdf742a26014 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 21 Oct 2020 14:57:35 -0300 Subject: [PATCH] ignore blocks marked as BLOCK_FAILED_VALID and BLOCK_FAILED_CHILD --- lbry/blockchain/database.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lbry/blockchain/database.py b/lbry/blockchain/database.py index 6ef795d3c..1c30d7304 100644 --- a/lbry/blockchain/database.py +++ b/lbry/blockchain/database.py @@ -117,7 +117,7 @@ class BlockchainDB: MAX(height) as best_height, MIN(height) as start_height FROM block_info - WHERE status&1 AND status&4 + WHERE status&1 AND status&4 AND NOT status&32 AND NOT status&64 """ args = () 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 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; """, (block_file, start_height) )]