mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Polish interfaces around PeerLogicValidation
* Make PeerLogicValidation final to prevent deriving from it [1]
* Prevent deletions of NetEventsInterface and CValidationInterface
objects via a base class pointer
[1] silences the following compiler warning (from Clang 7.0.0):
/usr/include/c++/v1/memory:2285:5: error: delete called on non-final 'PeerLogicValidation' that has
virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
delete __ptr;
^
/usr/include/c++/v1/memory:2598:7: note: in instantiation of member function
'std::__1::default_delete<PeerLogicValidation>::operator()' requested here
__ptr_.second()(__tmp);
^
init.cpp:201:15: note: in instantiation of member function 'std::__1::unique_ptr<PeerLogicValidation,
std::__1::default_delete<PeerLogicValidation> >::reset' requested here
peerLogic.reset();
^
This commit is contained in:
@@ -469,6 +469,13 @@ public:
|
||||
virtual bool SendMessages(CNode* pnode, std::atomic<bool>& interrupt) = 0;
|
||||
virtual void InitializeNode(CNode* pnode) = 0;
|
||||
virtual void FinalizeNode(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
|
||||
|
||||
Reference in New Issue
Block a user