Bitcoin ABC 0.30.7
P2P Digital Currency
|
Map a proof to each utxo. More...
#include <proofpool.h>
Public Types | |
enum | AddProofStatus { REJECTED = 0 , SUCCEED = 1 , DUPLICATED = 2 } |
using | ConflictingProofSet = std::set< ProofRef, ConflictingProofComparator > |
Public Member Functions | |
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. More... | |
AddProofStatus | addProofIfNoConflict (const ProofRef &proof) |
AddProofStatus | addProofIfPreferred (const ProofRef &proof, ConflictingProofSet &conflictingProofs) |
Attempt to add a proof to the pool. More... | |
AddProofStatus | addProofIfPreferred (const ProofRef &proof) |
bool | removeProof (ProofId proofid) |
std::unordered_set< ProofRef, SaltedProofHasher > | rescan (PeerManager &peerManager) |
template<typename Callable > | |
void | forEachProof (Callable &&func) const |
ProofIdSet | getProofIds () const |
ProofRef | getProof (const ProofId &proofid) const |
ProofRef | getProof (const COutPoint &outpoint) const |
ProofRef | getLowestScoreProof () const |
size_t | size () const |
size_t | countProofs () const |
Private Attributes | |
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 |
bool | cacheClean = true |
size_t | cacheProofCount = 0 |
Map a proof to each utxo.
A proof can be mapped with several utxos.
Definition at line 57 of file proofpool.h.
using avalanche::ProofPool::ConflictingProofSet = std::set<ProofRef, ConflictingProofComparator> |
Definition at line 88 of file proofpool.h.
Enumerator | |
---|---|
REJECTED | Rejected due to conflicts. |
SUCCEED | Added successfully. |
DUPLICATED | Already in pool. |
Definition at line 82 of file proofpool.h.
|
inline |
ProofPool::AddProofStatus avalanche::ProofPool::addProofIfNoConflict | ( | const ProofRef & | proof, |
ConflictingProofSet & | conflictingProofs | ||
) |
Attempt to add a proof to the pool, and fail if there is a conflict on any UTXO.
Definition at line 13 of file proofpool.cpp.
|
inline |
ProofPool::AddProofStatus avalanche::ProofPool::addProofIfPreferred | ( | const ProofRef & | proof, |
ConflictingProofSet & | conflictingProofs | ||
) |
Attempt to add a proof to the pool.
In case there is a conflict with one or more UTXO, the proof is only added if it is the best candidate over all the conflicting proofs according to ConflictingProofComparator.
Definition at line 54 of file proofpool.cpp.
size_t avalanche::ProofPool::countProofs | ( | ) | const |
Definition at line 129 of file proofpool.cpp.
|
inline |
ProofRef avalanche::ProofPool::getLowestScoreProof | ( | ) | const |
Definition at line 118 of file proofpool.cpp.
ProofIdSet avalanche::ProofPool::getProofIds | ( | ) | const |
bool avalanche::ProofPool::removeProof | ( | ProofId | proofid | ) |
std::unordered_set< ProofRef, SaltedProofHasher > avalanche::ProofPool::rescan | ( | PeerManager & | peerManager | ) |
Definition at line 86 of file proofpool.cpp.
|
inline |
|
mutableprivate |
Definition at line 78 of file proofpool.h.
|
mutableprivate |
Definition at line 79 of file proofpool.h.
|
private |
Definition at line 76 of file proofpool.h.