diff options
author | Carl Dong <contact@carldong.me> | 2022-03-15 19:19:58 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-03-15 19:42:43 -0400 |
commit | 28ba0313eac37e4a900b7e97af7169ce999c4024 (patch) | |
tree | 0e082ed3f96cbbefa53c23c1812d272d5a4862e9 /src/node/blockstorage.h | |
parent | 12eb05df63f930969115af6dc66e2e5d02f2a517 (diff) | |
download | bitcoin-28ba0313eac37e4a900b7e97af7169ce999c4024.tar.xz |
Add and use CBlockIndexHeightOnlyComparator
...also use std::sort for clarity
Diffstat (limited to 'src/node/blockstorage.h')
-rw-r--r-- | src/node/blockstorage.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index d230bdd24b..0fd87ddaf1 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -62,6 +62,11 @@ struct CBlockIndexWorkComparator { bool operator()(const CBlockIndex* pa, const CBlockIndex* pb) const; }; +struct CBlockIndexHeightOnlyComparator { + /* Only compares the height of two block indices, doesn't try to tie-break */ + bool operator()(const CBlockIndex* pa, const CBlockIndex* pb) const; +}; + /** * Maintains a tree of blocks (stored in `m_block_index`) which is consulted * to determine where the most-work tip is. |