Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proofpool.h
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | public: | ||||
* any UTXO. | * any UTXO. | ||||
*/ | */ | ||||
AddProofStatus addProofIfNoConflict(const ProofRef &proof); | AddProofStatus addProofIfNoConflict(const ProofRef &proof); | ||||
AddProofStatus addProofIfNoConflict(const ProofRef &proof, | AddProofStatus addProofIfNoConflict(const ProofRef &proof, | ||||
ConflictingProofSet &conflictingProofs); | ConflictingProofSet &conflictingProofs); | ||||
/** | /** | ||||
* Attempt to add a proof to the pool. In case there is a conflict with one | * 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 | * or more UTXO, the proof is only added if it is the best candidate over | ||||
* all the conflicting proofs according to ConflictingProofComparator. | * all the conflicting proofs according to ConflictingProofComparator and if | ||||
* the cooldown time has elapsed since the last registration for each UTXO. | |||||
*/ | */ | ||||
AddProofStatus addProofIfPreferred(const ProofRef &proof); | AddProofStatus addProofIfPreferred(const ProofRef &proof); | ||||
AddProofStatus addProofIfPreferred(const ProofRef &proof, | AddProofStatus addProofIfPreferred( | ||||
ConflictingProofSet &conflictingProofs); | const ProofRef &proof, ConflictingProofSet &conflictingProofs, | ||||
std::chrono::seconds cooldown = std::chrono::seconds{0}); | |||||
bool removeProof(ProofRef proof); | bool removeProof(ProofRef proof); | ||||
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; | ||||
std::chrono::seconds getRegistrationTime(const ProofId &proofid) const; | std::chrono::seconds getRegistrationTime(const ProofId &proofid) const; | ||||
size_t size() const { return pool.size(); } | size_t size() const { return pool.size(); } | ||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_PROOFPOOL_H | #endif // BITCOIN_AVALANCHE_PROOFPOOL_H |