merge bitcoin#22951: move amount.h into consensus

This commit is contained in:
Kittywhiskers Van Gogh 2024-10-21 17:59:23 +00:00
parent a0ab06f5c0
commit 20d15056f1
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
70 changed files with 83 additions and 68 deletions

View File

@ -699,11 +699,11 @@ crypto_libbitcoin_crypto_arm_shani_a_SOURCES = crypto/sha256_arm_shani.cpp
libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_consensus_a_SOURCES = \
amount.h \
arith_uint256.cpp \
arith_uint256.h \
bls/bls.cpp \
bls/bls.h \
consensus/amount.h \
consensus/merkle.cpp \
consensus/merkle.h \
consensus/params.h \

View File

@ -8,7 +8,7 @@
#ifndef BITCOIN_ADDRESSINDEX_H
#define BITCOIN_ADDRESSINDEX_H
#include <amount.h>
#include <consensus/amount.h>
#include <serialize.h>
#include <uint256.h>
#include <util/underlying.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_COINJOIN_COMMON_H
#define BITCOIN_COINJOIN_COMMON_H
#include <amount.h>
#include <consensus/amount.h>
#include <primitives/transaction.h>
#include <array>

View File

@ -5,7 +5,8 @@
#ifndef BITCOIN_COINJOIN_OPTIONS_H
#define BITCOIN_COINJOIN_OPTIONS_H
#include <amount.h>
#include <consensus/amount.h>
#include <atomic>
#include <mutex>

View File

@ -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 <stdint.h>
#include <cstdint>
/** 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

View File

@ -7,6 +7,7 @@
#include <consensus/consensus.h>
#include <consensus/tx_check.h>
#include <consensus/amount.h>
#include <primitives/transaction.h>
#include <consensus/validation.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_CONSENSUS_TX_VERIFY_H
#define BITCOIN_CONSENSUS_TX_VERIFY_H
#include <amount.h>
#include <consensus/amount.h>
#include <stdint.h>
#include <vector>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_CORE_IO_H
#define BITCOIN_CORE_IO_H
#include <amount.h>
#include <consensus/amount.h>
#include <attributes.h>
#include <string>

View File

@ -4,6 +4,7 @@
#include <core_io.h>
#include <consensus/amount.h>
#include <consensus/validation.h>
#include <key_io.h>
#include <primitives/transaction.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_EVO_DMN_TYPES_H
#define BITCOIN_EVO_DMN_TYPES_H
#include <amount.h>
#include <consensus/amount.h>
#include <limits>
#include <string_view>

View File

@ -4,7 +4,7 @@
#ifndef BITCOIN_GOVERNANCE_CLASSES_H
#define BITCOIN_GOVERNANCE_CLASSES_H
#include <amount.h>
#include <consensus/amount.h>
#include <governance/object.h>
#include <script/script.h>
#include <script/standard.h>

View File

@ -11,13 +11,13 @@
#include <init.h>
#include <addrman.h>
#include <amount.h>
#include <banman.h>
#include <base58.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <context.h>
#include <consensus/amount.h>
#include <deploymentstatus.h>
#include <node/coinstats.h>
#include <fs.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_INTERFACES_NODE_H
#define BITCOIN_INTERFACES_NODE_H
#include <amount.h> // For CAmount
#include <consensus/amount.h> // For CAmount
#include <net.h> // For NodeId
#include <net_types.h> // For banmap_t
#include <netaddress.h> // For Network

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_INTERFACES_WALLET_H
#define BITCOIN_INTERFACES_WALLET_H
#include <amount.h> // For CAmount
#include <consensus/amount.h> // For CAmount
#include <fs.h>
#include <interfaces/chain.h> // For ChainClient
#include <pubkey.h> // For CKeyID and CScriptID (definitions needed in CTxDestination instantiation)

View File

@ -4,9 +4,9 @@
#include <masternode/payments.h>
#include <amount.h>
#include <chain.h>
#include <chainparams.h>
#include <consensus/amount.h>
#include <deploymentstatus.h>
#include <evo/deterministicmns.h>
#include <governance/classes.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_MASTERNODE_PAYMENTS_H
#define BITCOIN_MASTERNODE_PAYMENTS_H
#include <amount.h>
#include <consensus/amount.h>
#include <string>
#include <vector>

View File

@ -6,9 +6,9 @@
#include <miner.h>
#include <amount.h>
#include <chain.h>
#include <chainparams.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <consensus/merkle.h>
#include <consensus/tx_verify.h>

View File

@ -10,6 +10,7 @@
#include <bloom.h>
#include <chainparams.h>
#include <compat.h>
#include <consensus/amount.h>
#include <fs.h>
#include <crypto/siphash.h>
#include <hash.h>

View File

@ -10,6 +10,7 @@
#include <blockencodings.h>
#include <blockfilter.h>
#include <chainparams.h>
#include <consensus/amount.h>
#include <consensus/validation.h>
#include <hash.h>
#include <index/blockfilterindex.h>

View File

@ -6,9 +6,9 @@
#ifndef BITCOIN_NODE_COINSTATS_H
#define BITCOIN_NODE_COINSTATS_H
#include <amount.h>
#include <chain.h>
#include <coins.h>
#include <consensus/amount.h>
#include <streams.h>
#include <uint256.h>

View File

@ -6,7 +6,7 @@
#ifndef BITCOIN_POLICY_FEERATE_H
#define BITCOIN_POLICY_FEERATE_H
#include <amount.h>
#include <consensus/amount.h>
#include <serialize.h>
#include <string>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_POLICY_FEES_H
#define BITCOIN_POLICY_FEES_H
#include <amount.h>
#include <consensus/amount.h>
#include <policy/feerate.h>
#include <uint256.h>
#include <random.h>

View File

@ -5,6 +5,7 @@
#include <primitives/transaction.h>
#include <consensus/amount.h>
#include <hash.h>
#include <tinyformat.h>
#include <util/strencodings.h>

View File

@ -6,7 +6,7 @@
#ifndef BITCOIN_PRIMITIVES_TRANSACTION_H
#define BITCOIN_PRIMITIVES_TRANSACTION_H
#include <amount.h>
#include <consensus/amount.h>
#include <script/script.h>
#include <serialize.h>
#include <uint256.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_QT_BITCOINAMOUNTFIELD_H
#define BITCOIN_QT_BITCOINAMOUNTFIELD_H
#include <amount.h>
#include <consensus/amount.h>
#include <QValidator>
#include <QWidget>

View File

@ -11,7 +11,7 @@
#include <qt/optionsdialog.h>
#include <amount.h>
#include <consensus/amount.h>
#include <QLabel>
#include <QMainWindow>

View File

@ -6,6 +6,8 @@
#include <qt/bitcoinunits.h>
#include <chainparams.h>
#include <consensus/amount.h>
#include <QSettings>
#include <QStringList>

View File

@ -6,7 +6,7 @@
#ifndef BITCOIN_QT_BITCOINUNITS_H
#define BITCOIN_QT_BITCOINUNITS_H
#include <amount.h>
#include <consensus/amount.h>
#include <QAbstractListModel>
#include <QString>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_QT_COINCONTROLDIALOG_H
#define BITCOIN_QT_COINCONTROLDIALOG_H
#include <amount.h>
#include <consensus/amount.h>
#include <QAbstractButton>
#include <QAction>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_QT_GUIUTIL_H
#define BITCOIN_QT_GUIUTIL_H
#include <amount.h>
#include <consensus/amount.h>
#include <fs.h>
#include <qt/guiconstants.h>
#include <net.h>

View File

@ -5,7 +5,6 @@
#ifndef BITCOIN_QT_OPTIONSMODEL_H
#define BITCOIN_QT_OPTIONSMODEL_H
#include <amount.h>
#include <qt/guiconstants.h>
#include <cstdint>

View File

@ -9,7 +9,7 @@
#include <config/bitcoin-config.h>
#endif
#include <amount.h>
#include <consensus/amount.h>
#include <serialize.h>
#include <string>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_QT_TRANSACTIONFILTERPROXY_H
#define BITCOIN_QT_TRANSACTIONFILTERPROXY_H
#include <amount.h>
#include <consensus/amount.h>
#include <QDateTime>
#include <QSortFilterProxyModel>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_QT_TRANSACTIONRECORD_H
#define BITCOIN_QT_TRANSACTIONRECORD_H
#include <amount.h>
#include <consensus/amount.h>
#include <uint256.h>
#include <key_io.h>

View File

@ -8,7 +8,7 @@
#include <primitives/transaction.h>
#include <qt/sendcoinsrecipient.h>
#include <amount.h>
#include <consensus/amount.h>
#include <QObject>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_QT_WALLETVIEW_H
#define BITCOIN_QT_WALLETVIEW_H
#include <amount.h>
#include <consensus/amount.h>
#include <qt/governancelist.h>
#include <qt/masternodelist.h>

View File

@ -6,11 +6,11 @@
#include <rpc/blockchain.h>
#include <amount.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <coins.h>
#include <consensus/amount.h>
#include <core_io.h>
#include <consensus/params.h>
#include <consensus/validation.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_RPC_BLOCKCHAIN_H
#define BITCOIN_RPC_BLOCKCHAIN_H
#include <amount.h>
#include <consensus/amount.h>
#include <core_io.h>
#include <streams.h>
#include <sync.h>

View File

@ -6,15 +6,15 @@
#ifndef BITCOIN_RPC_INDEX_UTIL_H
#define BITCOIN_RPC_INDEX_UTIL_H
#include <cstdint>
#include <vector>
#include <amount.h>
#include <consensus/amount.h>
#include <addressindex.h>
#include <spentindex.h>
#include <sync.h>
#include <threadsafety.h>
#include <cstdint>
#include <vector>
class CBlockTreeDB;
class CTxMemPool;
class uint160;

View File

@ -4,9 +4,9 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <amount.h>
#include <chain.h>
#include <chainparams.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <consensus/params.h>
#include <consensus/validation.h>

View File

@ -7,6 +7,7 @@
#include <chain.h>
#include <chainparams.h>
#include <coins.h>
#include <consensus/amount.h>
#include <consensus/tx_verify.h>
#include <consensus/validation.h>
#include <core_io.h>

View File

@ -6,6 +6,7 @@
#include <rpc/rawtransaction_util.h>
#include <coins.h>
#include <consensus/amount.h>
#include <core_io.h>
#include <interfaces/chain.h>
#include <key_io.h>

View File

@ -6,7 +6,6 @@
#ifndef BITCOIN_RPC_SERVER_H
#define BITCOIN_RPC_SERVER_H
#include <amount.h>
#include <rpc/request.h>
#include <rpc/util.h>

View File

@ -3,6 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <chainparamsbase.h>
#include <consensus/amount.h>
#include <key_io.h>
#include <outputtype.h>
#include <pubkey.h>

View File

@ -5,6 +5,7 @@
#include <script/sign.h>
#include <consensus/amount.h>
#include <key.h>
#include <policy/policy.h>
#include <primitives/transaction.h>

View File

@ -9,7 +9,7 @@
#define BITCOIN_SPENTINDEX_H
#include <addressindex.h>
#include <amount.h>
#include <consensus/amount.h>
#include <script/script.h>
#include <serialize.h>
#include <uint256.h>

View File

@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <amount.h>
#include <consensus/amount.h>
#include <policy/feerate.h>
#include <limits>

View File

@ -4,7 +4,7 @@
#include <test/util/setup_common.h>
#include <amount.h>
#include <consensus/amount.h>
#include <consensus/tx_check.h>
#include <consensus/validation.h>
#include <evo/assetlocktx.h>

View File

@ -2,10 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <amount.h>
#include <chainparams.h>
#include <chainparamsbase.h>
#include <coins.h>
#include <consensus/amount.h>
#include <consensus/tx_check.h>
#include <consensus/tx_verify.h>
#include <consensus/validation.h>

View File

@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <amount.h>
#include <consensus/amount.h>
#include <policy/feerate.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>

View File

@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <amount.h>
#include <consensus/amount.h>
#include <policy/fees.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>

View File

@ -5,6 +5,7 @@
#include <arith_uint256.h>
#include <chainparams.h>
#include <compressor.h>
#include <consensus/amount.h>
#include <consensus/merkle.h>
#include <core_io.h>
#include <crypto/common.h>

View File

@ -2,6 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <consensus/amount.h>
#include <pubkey.h>
#include <script/interpreter.h>
#include <streams.h>

View File

@ -5,12 +5,12 @@
#ifndef BITCOIN_TEST_FUZZ_UTIL_H
#define BITCOIN_TEST_FUZZ_UTIL_H
#include <amount.h>
#include <arith_uint256.h>
#include <attributes.h>
#include <chainparamsbase.h>
#include <coins.h>
#include <compat.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <key.h>
#include <merkleblock.h>

View File

@ -2,6 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <consensus/amount.h>
#include <net.h>
#include <uint256.h>
#include <validation.h>

View File

@ -15,17 +15,17 @@
#include <vector>
#include <addressindex.h>
#include <spentindex.h>
#include <amount.h>
#include <coins.h>
#include <consensus/amount.h>
#include <gsl/pointers.h>
#include <indirectmap.h>
#include <netaddress.h>
#include <policy/feerate.h>
#include <policy/packages.h>
#include <primitives/transaction.h>
#include <random.h>
#include <netaddress.h>
#include <pubkey.h>
#include <random.h>
#include <spentindex.h>
#include <sync.h>
#include <util/epochguard.h>
#include <util/hasher.h>

View File

@ -5,7 +5,7 @@
#include <util/moneystr.h>
#include <amount.h>
#include <consensus/amount.h>
#include <tinyformat.h>
#include <util/strencodings.h>
#include <util/string.h>

View File

@ -9,8 +9,8 @@
#ifndef BITCOIN_UTIL_MONEYSTR_H
#define BITCOIN_UTIL_MONEYSTR_H
#include <amount.h>
#include <attributes.h>
#include <consensus/amount.h>
#include <optional>
#include <string>

View File

@ -18,12 +18,12 @@
#include <attributes.h>
#include <compat.h>
#include <compat/assumptions.h>
#include <consensus/amount.h>
#include <fs.h>
#include <logging.h>
#include <sync.h>
#include <util/settings.h>
#include <util/time.h>
#include <amount.h>
#include <exception>
#include <map>

View File

@ -10,6 +10,7 @@
#include <chain.h>
#include <chainparams.h>
#include <checkqueue.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <consensus/merkle.h>
#include <consensus/tx_check.h>

View File

@ -11,10 +11,10 @@
#include <config/bitcoin-config.h>
#endif
#include <amount.h>
#include <arith_uint256.h>
#include <attributes.h>
#include <chain.h>
#include <consensus/amount.h>
#include <fs.h>
#include <node/blockstorage.h>
#include <policy/feerate.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_WALLET_COINSELECTION_H
#define BITCOIN_WALLET_COINSELECTION_H
#include <amount.h>
#include <consensus/amount.h>
#include <policy/feerate.h>
#include <primitives/transaction.h>
#include <random.h>

View File

@ -6,7 +6,7 @@
#ifndef BITCOIN_WALLET_FEES_H
#define BITCOIN_WALLET_FEES_H
#include <amount.h>
#include <consensus/amount.h>
class CCoinControl;
class CFeeRate;

View File

@ -4,8 +4,8 @@
#include <interfaces/wallet.h>
#include <amount.h>
#include <coinjoin/client.h>
#include <consensus/amount.h>
#include <interfaces/chain.h>
#include <interfaces/coinjoin.h>
#include <interfaces/handler.h>

View File

@ -4,8 +4,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <amount.h>
#include <chainparams.h>
#include <consensus/amount.h>
#include <core_io.h>
#include <httpserver.h>
#include <interfaces/chain.h>

View File

@ -4,12 +4,12 @@
#include <test/util/setup_common.h>
#include <amount.h>
#include <coinjoin/client.h>
#include <coinjoin/coinjoin.h>
#include <coinjoin/context.h>
#include <coinjoin/options.h>
#include <coinjoin/util.h>
#include <consensus/amount.h>
#include <node/context.h>
#include <util/translation.h>
#include <validation.h>

View File

@ -2,13 +2,14 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <amount.h>
#include <test/util/setup_common.h>
#include <consensus/amount.h>
#include <node/context.h>
#include <primitives/transaction.h>
#include <random.h>
#include <test/util/setup_common.h>
#include <validation.h>
#include <util/translation.h>
#include <validation.h>
#include <wallet/coincontrol.h>
#include <wallet/coinselection.h>
#include <wallet/test/wallet_test_fixture.h>

View File

@ -8,6 +8,7 @@
#include <chain.h>
#include <chainparams.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <crypto/common.h>

View File

@ -7,7 +7,7 @@
#ifndef BITCOIN_WALLET_WALLET_H
#define BITCOIN_WALLET_WALLET_H
#include <amount.h>
#include <consensus/amount.h>
#include <fs.h>
#include <governance/common.h>
#include <interfaces/chain.h>

View File

@ -6,7 +6,6 @@
#ifndef BITCOIN_WALLET_WALLETDB_H
#define BITCOIN_WALLET_WALLETDB_H
#include <amount.h>
#include <script/sign.h>
#include <wallet/db.h>
#include <wallet/walletutil.h>