refactor: use transparent comparator for setBlockIndexCandidates lookups

This allows checking for existence in setBlockIndexCandidates using a const CBlockIndex* without casting away constness, replacing a legacy const_cast check in validation.cpp.
This commit is contained in:
joaonevess
2025-12-30 04:27:53 -03:00
parent 2bcb3f6464
commit 3bd98b4508
2 changed files with 4 additions and 3 deletions

View File

@@ -136,6 +136,7 @@ using BlockMap = std::unordered_map<uint256, CBlockIndex, BlockHasher>;
struct CBlockIndexWorkComparator {
bool operator()(const CBlockIndex* pa, const CBlockIndex* pb) const;
using is_transparent = void;
};
struct CBlockIndexHeightOnlyComparator {