aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-06-08 08:54:23 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-14 13:58:02 -0400
commitfa457fbd3387661e1973a8f4e5cc2def79e0c625 (patch)
treeb067c61799628baa207c4a6fadfe6dec283b6320 /src
parenteac65d99ddb27061e6ae0f9448887db86e2c0734 (diff)
move-only: Move NDEBUG compile time check to util/check
Diffstat (limited to 'src')
-rw-r--r--src/net_processing.cpp11
-rw-r--r--src/util/check.h4
-rw-r--r--src/validation.cpp5
3 files changed, 9 insertions, 11 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index d48745aef2..06a6557b3b 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -13,10 +13,9 @@
#include <consensus/validation.h>
#include <hash.h>
#include <index/blockfilterindex.h>
-#include <validation.h>
#include <merkleblock.h>
-#include <netmessagemaker.h>
#include <netbase.h>
+#include <netmessagemaker.h>
#include <policy/fees.h>
#include <policy/policy.h>
#include <primitives/block.h>
@@ -26,16 +25,14 @@
#include <scheduler.h>
#include <tinyformat.h>
#include <txmempool.h>
-#include <util/system.h>
+#include <util/check.h> // For NDEBUG compile time check
#include <util/strencodings.h>
+#include <util/system.h>
+#include <validation.h>
#include <memory>
#include <typeinfo>
-#if defined(NDEBUG)
-# error "Bitcoin cannot be compiled without assertions."
-#endif
-
/** Expiration time for orphan transactions in seconds */
static constexpr int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;
/** Minimum time between orphan transactions expire time checks in seconds */
diff --git a/src/util/check.h b/src/util/check.h
index 5c0f32cf51..5cc078b36b 100644
--- a/src/util/check.h
+++ b/src/util/check.h
@@ -42,4 +42,8 @@ class NonFatalCheckError : public std::runtime_error
} \
} while (false)
+#if defined(NDEBUG)
+#error "Cannot compile without assertions!"
+#endif
+
#endif // BITCOIN_UTIL_CHECK_H
diff --git a/src/validation.cpp b/src/validation.cpp
index cbe89443b8..9f02db80c8 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -39,6 +39,7 @@
#include <ui_interface.h>
#include <uint256.h>
#include <undo.h>
+#include <util/check.h> // For NDEBUG compile time check
#include <util/moneystr.h>
#include <util/rbf.h>
#include <util/strencodings.h>
@@ -51,10 +52,6 @@
#include <boost/algorithm/string/replace.hpp>
-#if defined(NDEBUG)
-# error "Bitcoin cannot be compiled without assertions."
-#endif
-
#define MICRO 0.000001
#define MILLI 0.001