diff --git a/src/Makefile.am b/src/Makefile.am index e77612d6e9..f550448eab 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -523,10 +523,10 @@ crypto_libbitcoin_crypto_shani_a_SOURCES = crypto/sha256_shani.cpp libelements_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) libelements_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libelements_consensus_a_SOURCES = \ - amount.h \ arith_uint256.cpp \ arith_uint256.h \ asset.cpp \ + consensus/amount.h \ consensus/merkle.cpp \ consensus/merkle.h \ consensus/params.h \ diff --git a/src/asset.h b/src/asset.h index 6dc36f0fc3..d978d0bea6 100644 --- a/src/asset.h +++ b/src/asset.h @@ -4,7 +4,7 @@ #include -#include +#include #include /** diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 6967ab7af6..08b8a18dc6 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/src/confidential_validation.h b/src/confidential_validation.h index a148ab701c..36ec2d7455 100644 --- a/src/confidential_validation.h +++ b/src/confidential_validation.h @@ -2,7 +2,7 @@ #ifndef BITCOIN_CONFIDENTIAL_VALIDATION_H #define BITCOIN_CONFIDENTIAL_VALIDATION_H -#include +#include #include #include #include diff --git a/src/amount.h b/src/consensus/amount.h similarity index 80% rename from src/amount.h rename to src/consensus/amount.h index 47968e80b1..8b41a2277d 100644 --- a/src/amount.h +++ b/src/consensus/amount.h @@ -3,15 +3,15 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_AMOUNT_H -#define BITCOIN_AMOUNT_H +#ifndef BITCOIN_CONSENSUS_AMOUNT_H +#define BITCOIN_CONSENSUS_AMOUNT_H -#include +#include /** Amount in satoshis (Can be negative) */ typedef int64_t CAmount; -static const CAmount COIN = 100000000; +static constexpr CAmount COIN = 100000000; /** No amount larger than this (in satoshi) is valid. * @@ -22,7 +22,7 @@ static const CAmount COIN = 100000000; * critical; in unusual circumstances like a(nother) overflow bug that allowed * for the creation of coins out of thin air modification could lead to a fork. * */ -static const CAmount MAX_MONEY = 21000000 * COIN; +static constexpr CAmount MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } -#endif // BITCOIN_AMOUNT_H +#endif // BITCOIN_CONSENSUS_AMOUNT_H diff --git a/src/consensus/params.h b/src/consensus/params.h index 2ec98423c7..89209c5cc6 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -12,7 +12,7 @@ #include #include