1212#include < saltedhasher.h>
1313#include < sync.h>
1414
15+ #include < chainlock/signing.h>
16+
1517#include < gsl/pointers.h>
1618
1719#include < atomic>
@@ -25,9 +27,6 @@ class CMasternodeSync;
2527class CScheduler ;
2628class CSporkManager ;
2729class CTxMemPool ;
28- namespace chainlock {
29- class ChainLockSigner ;
30- } // namespace chainlock
3130
3231using NodeId = int64_t ;
3332
@@ -38,7 +37,7 @@ class CSigningManager;
3837class CSigSharesManager ;
3938enum class VerifyRecSigStatus ;
4039
41- class CChainLocksHandler
40+ class CChainLocksHandler final : public chainlock::ChainLockSignerParent
4241{
4342private:
4443 CChainState& m_chainstate;
@@ -80,11 +79,12 @@ class CChainLocksHandler
8079 bool AlreadyHave (const CInv& inv) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
8180 bool GetChainLockByHash (const uint256& hash, chainlock::ChainLockSig& ret) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
8281 chainlock::ChainLockSig GetBestChainLock () const EXCLUSIVE_LOCKS_REQUIRED(!cs);
83- void UpdateTxFirstSeenMap (const std::unordered_set<uint256, StaticSaltedHasher>& tx, const int64_t & time)
82+ void UpdateTxFirstSeenMap (const std::unordered_set<uint256, StaticSaltedHasher>& tx, const int64_t & time) override
8483 EXCLUSIVE_LOCKS_REQUIRED(!cs);
8584
8685 [[nodiscard]] MessageProcessingResult ProcessNewChainLock (NodeId from, const chainlock::ChainLockSig& clsig,
87- const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(!cs);
86+ const uint256& hash) override
87+ EXCLUSIVE_LOCKS_REQUIRED(!cs);
8888
8989 void AcceptedBlockHeader (gsl::not_null<const CBlockIndex*> pindexNew) EXCLUSIVE_LOCKS_REQUIRED(!cs);
9090 void UpdatedBlockTip (const llmq::CInstantSendManager& isman);
@@ -94,13 +94,17 @@ class CChainLocksHandler
9494 void CheckActiveState () EXCLUSIVE_LOCKS_REQUIRED(!cs);
9595 void EnforceBestChainLock () EXCLUSIVE_LOCKS_REQUIRED(!cs);
9696
97- bool HasChainLock (int nHeight, const uint256& blockHash) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
98- bool HasConflictingChainLock (int nHeight, const uint256& blockHash) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
97+ bool HasChainLock (int nHeight, const uint256& blockHash) const override
98+ EXCLUSIVE_LOCKS_REQUIRED(!cs);
99+ bool HasConflictingChainLock (int nHeight, const uint256& blockHash) const override
100+ EXCLUSIVE_LOCKS_REQUIRED(!cs);
99101 VerifyRecSigStatus VerifyChainLock (const chainlock::ChainLockSig& clsig) const ;
100102
101- [[nodiscard]] int32_t GetBestChainLockHeight () const EXCLUSIVE_LOCKS_REQUIRED(!cs);
102- bool IsTxSafeForMining (const uint256& txid) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
103- [[nodiscard]] bool IsEnabled () const { return isEnabled; }
103+ [[nodiscard]] int32_t GetBestChainLockHeight () const override
104+ EXCLUSIVE_LOCKS_REQUIRED(!cs);
105+ bool IsTxSafeForMining (const uint256& txid) const override
106+ EXCLUSIVE_LOCKS_REQUIRED(!cs);
107+ [[nodiscard]] bool IsEnabled () const override { return isEnabled; }
104108
105109private:
106110 void Cleanup () EXCLUSIVE_LOCKS_REQUIRED(!cs);
0 commit comments