2016-03-02 22:20:04 +01:00
|
|
|
// Copyright (c) 2015 The Bitcoin Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_DSNOTIFICATIONINTERFACE_H
|
|
|
|
#define BITCOIN_DSNOTIFICATIONINTERFACE_H
|
|
|
|
|
2020-03-19 23:46:56 +01:00
|
|
|
#include <validationinterface.h>
|
2016-03-02 22:20:04 +01:00
|
|
|
|
2022-09-22 13:14:48 +02:00
|
|
|
class CConnman;
|
|
|
|
class CDeterministicMNManager;
|
|
|
|
class CGovernanceManager;
|
|
|
|
class CMasternodeSync;
|
2022-11-07 19:09:44 +01:00
|
|
|
struct LLMQContext;
|
2022-09-22 13:14:48 +02:00
|
|
|
|
2016-03-02 22:20:04 +01:00
|
|
|
class CDSNotificationInterface : public CValidationInterface
|
|
|
|
{
|
|
|
|
public:
|
2022-09-22 13:14:48 +02:00
|
|
|
explicit CDSNotificationInterface(CConnman& _connman,
|
2023-06-04 22:26:23 +02:00
|
|
|
CMasternodeSync& _mn_sync, const std::unique_ptr<CDeterministicMNManager>& _dmnman,
|
|
|
|
CGovernanceManager& _govman, const std::unique_ptr<LLMQContext>& _llmq_ctx);
|
2017-08-29 01:51:33 +02:00
|
|
|
virtual ~CDSNotificationInterface() = default;
|
|
|
|
|
|
|
|
// a small helper to initialize current block height in sub-modules on startup
|
|
|
|
void InitializeCurrentBlockTip();
|
2016-03-02 22:20:04 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// CValidationInterface
|
2017-09-03 15:30:08 +02:00
|
|
|
void AcceptedBlockHeader(const CBlockIndex *pindexNew) override;
|
|
|
|
void NotifyHeaderTip(const CBlockIndex *pindexNew, bool fInitialDownload) override;
|
2020-03-20 17:11:54 +01:00
|
|
|
void SynchronousUpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
|
2017-08-29 01:51:33 +02:00
|
|
|
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
|
2019-12-07 11:56:17 +01:00
|
|
|
void TransactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime) override;
|
2021-05-19 01:02:31 +02:00
|
|
|
void TransactionRemovedFromMempool(const CTransactionRef& ptx, MemPoolRemovalReason reason) override;
|
2020-03-19 17:09:15 +01:00
|
|
|
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindex) override;
|
2019-05-27 14:55:29 +02:00
|
|
|
void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexDisconnected) override;
|
2022-04-07 17:32:40 +02:00
|
|
|
void NotifyMasternodeListChanged(bool undo, const CDeterministicMNList& oldMNList, const CDeterministicMNListDiff& diff, CConnman& connman) override;
|
2021-01-22 05:32:15 +01:00
|
|
|
void NotifyChainLock(const CBlockIndex* pindex, const std::shared_ptr<const llmq::CChainLockSig>& clsig) override;
|
2016-03-02 22:20:04 +01:00
|
|
|
|
|
|
|
private:
|
2017-09-19 16:51:38 +02:00
|
|
|
CConnman& connman;
|
2022-09-22 13:14:48 +02:00
|
|
|
|
2023-06-04 22:26:23 +02:00
|
|
|
CMasternodeSync& m_mn_sync;
|
|
|
|
const std::unique_ptr<CDeterministicMNManager>& dmnman;
|
|
|
|
CGovernanceManager& govman;
|
2022-09-22 13:14:48 +02:00
|
|
|
|
2023-06-04 22:26:23 +02:00
|
|
|
const std::unique_ptr<LLMQContext>& llmq_ctx;
|
2016-03-02 22:20:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BITCOIN_DSNOTIFICATIONINTERFACE_H
|