Skip to content

Commit fa457fb

Browse files
author
MarcoFalke
committed
move-only: Move NDEBUG compile time check to util/check
1 parent eac65d9 commit fa457fb

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/net_processing.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
#include <consensus/validation.h>
1414
#include <hash.h>
1515
#include <index/blockfilterindex.h>
16-
#include <validation.h>
1716
#include <merkleblock.h>
18-
#include <netmessagemaker.h>
1917
#include <netbase.h>
18+
#include <netmessagemaker.h>
2019
#include <policy/fees.h>
2120
#include <policy/policy.h>
2221
#include <primitives/block.h>
@@ -26,16 +25,14 @@
2625
#include <scheduler.h>
2726
#include <tinyformat.h>
2827
#include <txmempool.h>
29-
#include <util/system.h>
28+
#include <util/check.h> // For NDEBUG compile time check
3029
#include <util/strencodings.h>
30+
#include <util/system.h>
31+
#include <validation.h>
3132

3233
#include <memory>
3334
#include <typeinfo>
3435

35-
#if defined(NDEBUG)
36-
# error "Bitcoin cannot be compiled without assertions."
37-
#endif
38-
3936
/** Expiration time for orphan transactions in seconds */
4037
static constexpr int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;
4138
/** Minimum time between orphan transactions expire time checks in seconds */

src/util/check.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@ class NonFatalCheckError : public std::runtime_error
4242
} \
4343
} while (false)
4444

45+
#if defined(NDEBUG)
46+
#error "Cannot compile without assertions!"
47+
#endif
48+
4549
#endif // BITCOIN_UTIL_CHECK_H

src/validation.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <ui_interface.h>
4040
#include <uint256.h>
4141
#include <undo.h>
42+
#include <util/check.h> // For NDEBUG compile time check
4243
#include <util/moneystr.h>
4344
#include <util/rbf.h>
4445
#include <util/strencodings.h>
@@ -51,10 +52,6 @@
5152

5253
#include <boost/algorithm/string/replace.hpp>
5354

54-
#if defined(NDEBUG)
55-
# error "Bitcoin cannot be compiled without assertions."
56-
#endif
57-
5855
#define MICRO 0.000001
5956
#define MILLI 0.001
6057

0 commit comments

Comments
 (0)