6 #ifndef PIVX_LLMQ_QUORUMS_SIGNING_H
7 #define PIVX_LLMQ_QUORUMS_SIGNING_H
17 #include <unordered_map>
149 std::unordered_map<
NodeId, std::list<CRecoveredSig>>& retSigShares,
Batch of changes queued to be written to a CDBWrapper.
Information about a peer.
const uint256 & GetHash() const
SERIALIZE_METHODS(CRecoveredSig, obj)
void CleanupOldVotes(int64_t maxAge)
bool HasRecoveredSigForHash(const uint256 &hash)
bool HasRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
CRecoveredSigsDb(CDBWrapper &_db)
unordered_lru_cache< uint256, bool, StaticSaltedHasher, 30000 > hasSigForHashCache
bool GetVoteForId(Consensus::LLMQType llmqType, const uint256 &id, uint256 &msgHashRet)
unordered_lru_cache< std::pair< Consensus::LLMQType, uint256 >, bool, StaticSaltedHasher, 30000 > hasSigForIdCache
void TruncateRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id)
bool ReadRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id, CRecoveredSig &ret)
void RemoveRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id)
void WriteVoteForId(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
void ConvertInvalidTimeKeys()
unordered_lru_cache< uint256, bool, StaticSaltedHasher, 30000 > hasSigForSessionCache
bool HasRecoveredSigForSession(const uint256 &signHash)
void CleanupOldRecoveredSigs(int64_t maxAge)
bool GetRecoveredSigById(Consensus::LLMQType llmqType, const uint256 &id, CRecoveredSig &ret)
void WriteRecoveredSig(const CRecoveredSig &recSig)
bool GetRecoveredSigByHash(const uint256 &hash, CRecoveredSig &ret)
bool HasVotedOnId(Consensus::LLMQType llmqType, const uint256 &id)
bool HasRecoveredSigForId(Consensus::LLMQType llmqType, const uint256 &id)
virtual void HandleNewRecoveredSig(const CRecoveredSig &recoveredSig)=0
virtual ~CRecoveredSigsListener()
void TruncateRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id)
void ProcessMessage(CNode *pnode, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
bool HasRecoveredSigForSession(const uint256 &signHash)
CQuorumCPtr SelectQuorumForSigning(Consensus::LLMQType llmqType, const uint256 &selectionHash, int signHeight=-1, int signOffset=SIGN_HEIGHT_OFFSET)
bool AsyncSignIfMember(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash, bool allowReSign=false)
void ProcessRecoveredSig(NodeId nodeId, const CRecoveredSig &recoveredSig, const CQuorumCPtr &quorum, CConnman &connman)
bool VerifyRecoveredSig(Consensus::LLMQType llmqType, int signedAtHeight, const uint256 &id, const uint256 &msgHash, const CBLSSignature &sig)
bool HasRecoveredSigForId(Consensus::LLMQType llmqType, const uint256 &id)
void UnregisterRecoveredSigsListener(CRecoveredSigsListener *l)
bool AlreadyHave(const CInv &inv)
bool PreVerifyRecoveredSig(NodeId nodeId, const CRecoveredSig &recoveredSig, bool &retBan)
bool HasRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
bool GetRecoveredSigForGetData(const uint256 &hash, CRecoveredSig &ret)
bool ProcessPendingRecoveredSigs(CConnman &connman)
static const int64_t DEFAULT_MAX_RECOVERED_SIGS_AGE
void ProcessMessageRecoveredSig(CNode *pfrom, const CRecoveredSig &recoveredSig, CConnman &connman)
std::unordered_map< NodeId, std::list< CRecoveredSig > > pendingRecoveredSigs
CSigningManager(CDBWrapper &llmqDb, bool fMemory)
bool HasVotedOnId(Consensus::LLMQType llmqType, const uint256 &id)
bool GetVoteForId(Consensus::LLMQType llmqType, const uint256 &id, uint256 &msgHashRet)
void CollectPendingRecoveredSigsToVerify(size_t maxUniqueSessions, std::unordered_map< NodeId, std::list< CRecoveredSig >> &retSigShares, std::unordered_map< std::pair< Consensus::LLMQType, uint256 >, CQuorumCPtr, StaticSaltedHasher > &retQuorums)
bool IsConflicting(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
void RegisterRecoveredSigsListener(CRecoveredSigsListener *l)
std::vector< CQuorumCPtr > GetActiveQuorumSet(Consensus::LLMQType llmqType, int signHeight)
std::vector< CRecoveredSigsListener * > recoveredSigsListeners
static const int SIGN_HEIGHT_OFFSET
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
std::shared_ptr< const CQuorum > CQuorumCPtr
std::unique_ptr< CSigningManager > quorumSigningManager
#define SER_READ(obj, code)