![]() |
Bitcoin ABC 0.33.11
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) |
| ConflictingProofSet | getConflicts (const ProofRef &proof) const |
| Return proofs in this pool that share any UTXO with proof. More... | |
| 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 56 of file proofpool.h.
| using avalanche::ProofPool::ConflictingProofSet = std::set<ProofRef, ConflictingProofComparator> |
Definition at line 87 of file proofpool.h.
| Enumerator | |
|---|---|
| REJECTED | Rejected due to conflicts. |
| SUCCEED | Added successfully. |
| DUPLICATED | Already in pool. |
Definition at line 81 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 30 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 58 of file proofpool.cpp.
| size_t avalanche::ProofPool::countProofs | ( | ) | const |
Definition at line 133 of file proofpool.cpp.
|
inline |
| ProofPool::ConflictingProofSet avalanche::ProofPool::getConflicts | ( | const ProofRef & | proof | ) | const |
Return proofs in this pool that share any UTXO with proof.
The proof itself is excluded if it is already in the pool.
Definition at line 14 of file proofpool.cpp.
| ProofRef avalanche::ProofPool::getLowestScoreProof | ( | ) | const |
Definition at line 122 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 90 of file proofpool.cpp.
|
inline |
|
mutableprivate |
Definition at line 77 of file proofpool.h.
|
mutableprivate |
Definition at line 78 of file proofpool.h.
|
private |
Definition at line 75 of file proofpool.h.