Skip to content

Commit 211d2f4

Browse files
committed
merge bitcoin#22951: move amount.h into consensus
1 parent b2930f5 commit 211d2f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2294
-58
lines changed

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,11 +637,11 @@ crypto_libbitcoin_crypto_arm_shani_a_SOURCES = crypto/sha256_arm_shani.cpp
637637
libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
638638
libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
639639
libbitcoin_consensus_a_SOURCES = \
640-
amount.h \
641640
arith_uint256.cpp \
642641
arith_uint256.h \
643642
bls/bls.cpp \
644643
bls/bls.h \
644+
consensus/amount.h \
645645
consensus/merkle.cpp \
646646
consensus/merkle.h \
647647
consensus/params.h \

src/addressindex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#ifndef BITCOIN_ADDRESSINDEX_H
77
#define BITCOIN_ADDRESSINDEX_H
88

9+
#include <consensus/amount.h>
910
#include <uint256.h>
10-
#include <amount.h>
1111

1212
#include <chrono>
1313

src/bitcoin-tx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <chainparams.h>
1010
#include <clientversion.h>
1111
#include <coins.h>
12+
#include <consensus/amount.h>
1213
#include <consensus/consensus.h>
1314
#include <core_io.h>
1415
#include <key_io.h>

src/coinjoin/options.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
#ifndef BITCOIN_COINJOIN_OPTIONS_H
66
#define BITCOIN_COINJOIN_OPTIONS_H
77

8-
#include <amount.h>
8+
#include <consensus/amount.h>
9+
910
#include <atomic>
1011
#include <mutex>
1112

src/amount.h renamed to src/consensus/amount.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6-
#ifndef BITCOIN_AMOUNT_H
7-
#define BITCOIN_AMOUNT_H
6+
#ifndef BITCOIN_CONSENSUS_AMOUNT_H
7+
#define BITCOIN_CONSENSUS_AMOUNT_H
88

9-
#include <stdint.h>
9+
#include <cstdint>
1010

1111
/** Amount in satoshis (Can be negative) */
1212
typedef int64_t CAmount;
1313

14-
static const CAmount COIN = 100000000;
14+
static constexpr CAmount COIN = 100000000;
1515

1616
/** No amount larger than this (in satoshi) is valid.
1717
*
@@ -22,7 +22,7 @@ static const CAmount COIN = 100000000;
2222
* critical; in unusual circumstances like a(nother) overflow bug that allowed
2323
* for the creation of coins out of thin air modification could lead to a fork.
2424
* */
25-
static const CAmount MAX_MONEY = 21000000 * COIN;
25+
static constexpr CAmount MAX_MONEY = 21000000 * COIN;
2626
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
2727

28-
#endif // BITCOIN_AMOUNT_H
28+
#endif // BITCOIN_CONSENSUS_AMOUNT_H

src/consensus/tx_check.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <consensus/consensus.h>
88
#include <consensus/tx_check.h>
99

10+
#include <consensus/amount.h>
1011
#include <primitives/transaction.h>
1112
#include <consensus/validation.h>
1213

src/consensus/tx_verify.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <consensus/tx_verify.h>
66

7+
#include <consensus/amount.h>
78
#include <consensus/consensus.h>
89
#include <primitives/transaction.h>
910
#include <script/interpreter.h>

src/consensus/tx_verify.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#ifndef BITCOIN_CONSENSUS_TX_VERIFY_H
66
#define BITCOIN_CONSENSUS_TX_VERIFY_H
77

8-
#include <amount.h>
8+
#include <consensus/amount.h>
99

1010
#include <stdint.h>
1111
#include <vector>

src/core_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#ifndef BITCOIN_CORE_IO_H
66
#define BITCOIN_CORE_IO_H
77

8-
#include <amount.h>
8+
#include <consensus/amount.h>
99
#include <attributes.h>
1010

1111
#include <string>

src/core_write.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <core_io.h>
66

7+
#include <consensus/amount.h>
78
#include <consensus/validation.h>
89
#include <key_io.h>
910
#include <primitives/transaction.h>

0 commit comments

Comments
 (0)