Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
rewardrankcomparator.h
Go to the documentation of this file.
1// Copyright (c) 2025 The Bitcoin developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_AVALANCHE_REWARDRANKCOMPARATOR_H
6#define BITCOIN_AVALANCHE_REWARDRANKCOMPARATOR_H
7
8#include <avalanche/proofid.h>
10
11namespace avalanche {
12
15 const ProofId &leftProofId,
17 const ProofId &rightProofId) const {
18 if (leftRank != rightRank) {
19 // Lowest rank is best
20 return leftRank < rightRank;
21 }
22
23 // If there's a collision in rank, sort by contender id
26 }
27
28 // If there's a collision in contender id, sort by proof id
30 }
31};
32
33} // namespace avalanche
34
35#endif // BITCOIN_AVALANCHE_REWARDRANKCOMPARATOR_H
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...
Definition random.h:85
bool operator()(const StakeContenderId &leftContenderId, double leftRank, const ProofId &leftProofId, const StakeContenderId &rightContenderId, double rightRank, const ProofId &rightProofId) const
StakeContenderIds are unique for each block to ensure that the peer polling for their acceptance has ...