Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proofpool.h
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | boost::multi_index_container< | ||||
&ProofPoolEntry::getUTXO>, | &ProofPoolEntry::getUTXO>, | ||||
SaltedOutpointHasher>, | SaltedOutpointHasher>, | ||||
// index by proofid | // index by proofid | ||||
bmi::hashed_non_unique<bmi::tag<by_proofid>, | bmi::hashed_non_unique<bmi::tag<by_proofid>, | ||||
ProofPoolEntryProofIdKeyExtractor, | ProofPoolEntryProofIdKeyExtractor, | ||||
SaltedProofIdHasher>>> | SaltedProofIdHasher>>> | ||||
pool; | pool; | ||||
size_t proofCount = 0; | |||||
public: | public: | ||||
enum AddProofStatus { | enum AddProofStatus { | ||||
REJECTED = 0, //!< Rejected due to conflicts | REJECTED = 0, //!< Rejected due to conflicts | ||||
SUCCEED = 1, //!< Added successfully | SUCCEED = 1, //!< Added successfully | ||||
DUPLICATED = 2, //!< Already in pool | DUPLICATED = 2, //!< Already in pool | ||||
}; | }; | ||||
using ConflictingProofSet = std::set<ProofRef, ConflictingProofComparator>; | using ConflictingProofSet = std::set<ProofRef, ConflictingProofComparator>; | ||||
Show All 24 Lines | public: | ||||
bool removeProof(ProofId proofid); | bool removeProof(ProofId proofid); | ||||
void rescan(PeerManager &peerManager); | void rescan(PeerManager &peerManager); | ||||
ProofRef getProof(const ProofId &proofid) const; | ProofRef getProof(const ProofId &proofid) const; | ||||
ProofRef getProof(const COutPoint &outpoint) const; | ProofRef getProof(const COutPoint &outpoint) const; | ||||
size_t size() const { return pool.size(); } | size_t size() const { return pool.size(); } | ||||
size_t getProofCount() const { return proofCount; } | |||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_PROOFPOOL_H | #endif // BITCOIN_AVALANCHE_PROOFPOOL_H |