5#ifndef BITCOIN_BLOCKINDEXCOMPARATORS_H
6#define BITCOIN_BLOCKINDEXCOMPARATORS_H
13 if (
pa->nChainWork >
pb->nChainWork) {
16 if (
pa->nChainWork <
pb->nChainWork) {
21 if (
pa->nSequenceId <
pb->nSequenceId) {
24 if (
pa->nSequenceId >
pb->nSequenceId) {
47 return pa->nHeight <
pb->nHeight;
The block chain is a tree shaped structure starting with the genesis block at the root,...
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
bool operator()(const CBlockIndex *pa, const CBlockIndex *pb) const
Only compares the height of two block indices, doesn't try to tie-break.
bool operator()(const CBlockIndex *pa, const CBlockIndex *pb) const