Skip to content

Commit ab2a2de

Browse files
laanwjDuddino
authored andcommitted
Add missing virtual destructor in PeerLogicValidation (bitcoin#12680)
1 parent a917e3b commit ab2a2de

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/net.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,13 @@ class NetEventsInterface
962962
virtual bool SendMessages(CNode* pnode, std::atomic<bool>& interrupt) EXCLUSIVE_LOCKS_REQUIRED(pnode->cs_sendProcessing) = 0;
963963
virtual void InitializeNode(CNode* pnode) = 0;
964964
virtual void FinalizeNode(NodeId id, bool& update_connection_time) = 0;
965+
966+
protected:
967+
/**
968+
* Protected destructor so that instances can only be deleted by derived classes.
969+
* If that restriction is no longer desired, this should be made public and virtual.
970+
*/
971+
~NetEventsInterface() = default;
965972
};
966973

967974
/** Return a timestamp in the future (in microseconds) for exponentially distributed events. */

src/net_processing.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ static const unsigned int INVENTORY_BROADCAST_INTERVAL = 5;
3232
* Limits the impact of low-fee transaction floods. */
3333
static const unsigned int INVENTORY_BROADCAST_MAX = 7 * INVENTORY_BROADCAST_INTERVAL;
3434

35-
class PeerLogicValidation : public CValidationInterface, public NetEventsInterface {
35+
class PeerLogicValidation final : public CValidationInterface, public NetEventsInterface
36+
{
3637
private:
3738
CConnman* connman;
3839

0 commit comments

Comments
 (0)