5#ifndef BITCOIN_AVALANCHE_PROOFCOMPARATOR_H
6#define BITCOIN_AVALANCHE_PROOFCOMPARATOR_H
20 return lhs.get() <
rhs.get();
33 :
lhs.getId() <
rhs.getId();
37 return (*
this)(*
lhs, *
rhs);
52 if (
lhs.getMaster() ==
rhs.getMaster()) {
53 if (
lhs.getSequence() !=
rhs.getSequence()) {
54 return lhs.getSequence() >
rhs.getSequence();
60 if (
lhs.getScore() !=
rhs.getScore()) {
61 return lhs.getScore() >
rhs.getScore();
66 if (
lhs.getStakes().size() !=
rhs.getStakes().size()) {
67 return lhs.getStakes().size() <
rhs.getStakes().size();
72 return lhs.getId() <
rhs.getId();
76 return (*
this)(*
lhs, *
rhs);
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...
Compare conflicting proofs.
bool operator()(const ProofRef &lhs, const ProofRef &rhs) const
bool operator()(const Proof &lhs, const Proof &rhs) const
Compare proofs by score, then by id in case of equality.
bool operator()(const Proof &lhs, const Proof &rhs) const
bool operator()(const ProofRef &lhs, const ProofRef &rhs) const
Compare proof references by pointer address.
bool operator()(const ProofRef &lhs, const ProofRef &rhs) const