mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-12 16:47:58 +02:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user