15 const ProofId &proofid = proof->getId();
26 for (
size_t i = 0; i < proof->getStakes().size(); i++) {
27 auto p =
pool.emplace(i, proof);
36 for (
const auto &s : proof->getStakes()) {
37 auto it =
pool.find(s.getStake().getUTXO());
41 if (it->proof->getId() == proofid) {
85std::unordered_set<ProofRef, SaltedProofHasher>
106 proofIds.insert(it->proof->getId());
119 auto it =
pool.find(outpoint);
T * get()
Get allows to access the undelying pointer.
@ DUPLICATED
Already in pool.
@ REJECTED
Rejected due to conflicts.
@ SUCCEED
Added successfully.
AddProofStatus addProofIfPreferred(const ProofRef &proof, ConflictingProofSet &conflictingProofs)
Attempt to add a proof to the pool.
AddProofStatus addProofIfNoConflict(const ProofRef &proof, ConflictingProofSet &conflictingProofs)
Attempt to add a proof to the pool, and fail if there is a conflict on any UTXO.
size_t countProofs() const
bool removeProof(ProofId proofid)
void forEachProof(Callable &&func) const
ProofRef getProof(const ProofId &proofid) const
std::set< ProofRef, ConflictingProofComparator > ConflictingProofSet
ProofRef getLowestScoreProof() const
boost::multi_index_container< ProofPoolEntry, bmi::indexed_by< bmi::hashed_unique< bmi::tag< by_utxo >, bmi::const_mem_fun< ProofPoolEntry, const COutPoint &, &ProofPoolEntry::getUTXO >, SaltedOutpointHasher >, bmi::hashed_non_unique< bmi::tag< by_proofid >, ProofPoolEntryProofIdKeyExtractor, SaltedProofIdHasher >, bmi::ordered_non_unique< bmi::tag< by_proof_score >, bmi::member< ProofPoolEntry, ProofRef, &ProofPoolEntry::proof >, ProofComparatorByScore > > > pool
std::unordered_set< ProofRef, SaltedProofHasher > rescan(PeerManager &peerManager)
ProofIdSet getProofIds() const
std::unordered_set< ProofId, SaltedProofIdHasher > ProofIdSet
RCUPtr< const Proof > ProofRef
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.