mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
validation: Don't use IsValid() to filter for invalid blocks
IsValid() also returns false for blocks that have not been validated yet up to the default validity level of BLOCK_VALID_TRANSACTIONS but are not marked as invalid - e.g. if we only know the header. Here, we specifically want to filter for invalid blocks. Also removes the default arg from IsValid() which is now unused outside of tests, to prevent this kind of misuse for the future. Co-authored-by: TheCharlatan <seb.kung@gmail.com>
This commit is contained in:
@@ -30,7 +30,7 @@ FUZZ_TARGET(chain)
|
||||
(void)disk_block_index->GetMedianTimePast();
|
||||
(void)disk_block_index->GetUndoPos();
|
||||
(void)disk_block_index->HaveNumChainTxs();
|
||||
(void)disk_block_index->IsValid();
|
||||
(void)disk_block_index->IsValid(BLOCK_VALID_TRANSACTIONS);
|
||||
}
|
||||
|
||||
const CBlockHeader block_header = disk_block_index->GetBlockHeader();
|
||||
|
||||
Reference in New Issue
Block a user