diff --git a/src/net.h b/src/net.h --- a/src/net.h +++ b/src/net.h @@ -448,6 +448,14 @@ virtual void InitializeNode(const Config &config, CNode *pnode) = 0; virtual void FinalizeNode(const Config &config, NodeId id, bool &update_connection_time) = 0; + +protected: + /** + * Protected destructor so that instances can only be deleted by derived + * classes. If that restriction is no longer desired, this should be made + * public and virtual. + */ + ~NetEventsInterface() = default; }; enum { diff --git a/src/net_processing.h b/src/net_processing.h --- a/src/net_processing.h +++ b/src/net_processing.h @@ -26,8 +26,8 @@ */ static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100; -class PeerLogicValidation : public CValidationInterface, - public NetEventsInterface { +class PeerLogicValidation final : public CValidationInterface, + public NetEventsInterface { private: CConnman *connman; diff --git a/src/validationinterface.h b/src/validationinterface.h --- a/src/validationinterface.h +++ b/src/validationinterface.h @@ -33,9 +33,25 @@ class CValidationInterface { protected: + /** + * Protected destructor so that instances can only be deleted by derived + * classes. If that restriction is no longer desired, this should be made + * public and virtual. + */ + ~CValidationInterface() = default; + /** + * Notifies listeners of updated block chain tip + * + * Called on a background thread. + */ virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {} + /** + * Notifies listeners of a transaction having been added to mempool. + * + * Called on a background thread. + */ virtual void TransactionAddedToMempool(const CTransactionRef &ptxn) {} virtual void BlockConnected(const std::shared_ptr &block,