From 0aed17ef2892478c28cd660e53223c6dd1dc0187 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Fri, 8 Nov 2019 13:22:36 -0800 Subject: Refactor FormatStateMessage into ValidationState --- src/util/validation.cpp | 23 ----------------------- src/util/validation.h | 16 ---------------- 2 files changed, 39 deletions(-) delete mode 100644 src/util/validation.cpp delete mode 100644 src/util/validation.h (limited to 'src/util') diff --git a/src/util/validation.cpp b/src/util/validation.cpp deleted file mode 100644 index ffbee21aeb..0000000000 --- a/src/util/validation.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2020 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 - -#include -#include - -std::string FormatStateMessage(const ValidationState &state) -{ - if (state.IsValid()) { - return "Valid"; - } - - const std::string debug_message = state.GetDebugMessage(); - if (!debug_message.empty()) { - return strprintf("%s, %s", state.GetRejectReason(), debug_message); - } - - return state.GetRejectReason(); -} diff --git a/src/util/validation.h b/src/util/validation.h deleted file mode 100644 index 5ee260a055..0000000000 --- a/src/util/validation.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-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. - -#ifndef BITCOIN_UTIL_VALIDATION_H -#define BITCOIN_UTIL_VALIDATION_H - -#include - -class ValidationState; - -/** Convert ValidationState to a human-readable message for logging */ -std::string FormatStateMessage(const ValidationState &state); - -#endif // BITCOIN_UTIL_VALIDATION_H -- cgit v1.2.3