Skip to content

Commit

Permalink
fixup: make ValidationState abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewbery committed Oct 29, 2019
1 parent ea83274 commit 2fc16d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Makefile.am
Expand Up @@ -418,6 +418,7 @@ libbitcoin_consensus_a_SOURCES = \
consensus/merkle.h \
consensus/params.h \
consensus/tx_check.cpp \
consensus/validation.cpp \
consensus/validation.h \
hash.cpp \
hash.h \
Expand Down
7 changes: 7 additions & 0 deletions src/consensus/validation.cpp
@@ -0,0 +1,7 @@
// Copyright (c) 2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <consensus/validation.h>

ValidationState::~ValidationState() {}
4 changes: 2 additions & 2 deletions src/consensus/validation.h
Expand Up @@ -92,8 +92,8 @@ class ValidationState {
if (m_mode != MODE_ERROR) m_mode = MODE_INVALID;
}
public:
// We use ValidationState polymorphically. Have a virtual destructor
virtual ~ValidationState() {}
// ValidationState is abstract. Have a pure virtual destructor.
virtual ~ValidationState() = 0;

ValidationState() : m_mode(MODE_VALID) {}
bool Error(const std::string& reject_reason)
Expand Down

0 comments on commit 2fc16d7

Please sign in to comment.