aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-11-26 09:03:34 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-11-26 09:03:39 +0100
commit16d698cdcf3c4ef34bae4ccd616d0ddc4a7165d4 (patch)
treed9b271f70ca219972c29f35256934502482e944d
parent14fe4dbd4c897ccd79fe70c33f75661bbc66ab66 (diff)
parentfa4e09924b11b0dc94e377005f86a83c09761265 (diff)
Merge bitcoin/bitcoin#23517: scripted-diff: Move miner to src/node
fa4e09924b11b0dc94e377005f86a83c09761265 refactor: Replace validation.h include with forward-decl in miner.h (MarcoFalke) fa0739a7d398aea952a07b73ef565e7c2da75898 style: Sort file list after rename (MarcoFalke) fa53e3a58c94731a90514fe92fad365a49adb10c scripted-diff: Move miner to src/node (MarcoFalke) Pull request description: It is impossible to run the miner without a node (validation, chainstate, mempool, rpc, ...). Also, the module is in the node library. Thus, it should be moved to `src/node`. Also, replace the `validation.h` include in the header with a forward-declaration. ACKs for top commit: theStack: Code-review ACK fa4e09924b11b0dc94e377005f86a83c09761265 Tree-SHA512: 791e6caa5839d8dc83b0f58f3f49bc0a7e3c1710822e8a44dede254c87b6f7531a0586fb95e8a067c181457a3895ad6041718aa2a2fac64cfc136bf04bb851d5
-rw-r--r--src/Makefile.am4
-rw-r--r--src/init.cpp2
-rw-r--r--src/node/miner.cpp (renamed from src/miner.cpp)3
-rw-r--r--src/node/miner.h (renamed from src/miner.h)10
-rw-r--r--src/rpc/mining.cpp2
-rw-r--r--src/test/blockfilter_index_tests.cpp2
-rw-r--r--src/test/fuzz/tx_pool.cpp2
-rw-r--r--src/test/miner_tests.cpp2
-rw-r--r--src/test/util/mining.cpp2
-rw-r--r--src/test/util/setup_common.cpp2
-rw-r--r--src/test/validation_block_tests.cpp2
-rw-r--r--test/sanitizer_suppressions/ubsan2
12 files changed, 18 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 05d7d09f13..9d79ee0e62 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -166,7 +166,6 @@ BITCOIN_CORE_H = \
mapport.h \
memusage.h \
merkleblock.h \
- miner.h \
net.h \
net_permissions.h \
net_processing.h \
@@ -178,6 +177,7 @@ BITCOIN_CORE_H = \
node/coin.h \
node/coinstats.h \
node/context.h \
+ node/miner.h \
node/minisketchwrapper.h \
node/psbt.h \
node/transaction.h \
@@ -335,7 +335,6 @@ libbitcoin_server_a_SOURCES = \
index/txindex.cpp \
init.cpp \
mapport.cpp \
- miner.cpp \
net.cpp \
net_processing.cpp \
node/blockstorage.cpp \
@@ -343,6 +342,7 @@ libbitcoin_server_a_SOURCES = \
node/coinstats.cpp \
node/context.cpp \
node/interfaces.cpp \
+ node/miner.cpp \
node/minisketchwrapper.cpp \
node/psbt.cpp \
node/transaction.cpp \
diff --git a/src/init.cpp b/src/init.cpp
index a2060daf45..d5c3acbaad 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -29,13 +29,13 @@
#include <interfaces/init.h>
#include <interfaces/node.h>
#include <mapport.h>
-#include <miner.h>
#include <net.h>
#include <net_permissions.h>
#include <net_processing.h>
#include <netbase.h>
#include <node/blockstorage.h>
#include <node/context.h>
+#include <node/miner.h>
#include <node/ui_interface.h>
#include <policy/feerate.h>
#include <policy/fees.h>
diff --git a/src/miner.cpp b/src/node/miner.cpp
index 1ef246cd14..8778a79f8b 100644
--- a/src/miner.cpp
+++ b/src/node/miner.cpp
@@ -3,7 +3,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include <miner.h>
+#include <node/miner.h>
#include <chain.h>
#include <chainparams.h>
@@ -21,6 +21,7 @@
#include <timedata.h>
#include <util/moneystr.h>
#include <util/system.h>
+#include <validation.h>
#include <algorithm>
#include <utility>
diff --git a/src/miner.h b/src/node/miner.h
index 10a80f4392..0e8c02793a 100644
--- a/src/miner.h
+++ b/src/node/miner.h
@@ -3,20 +3,20 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#ifndef BITCOIN_MINER_H
-#define BITCOIN_MINER_H
+#ifndef BITCOIN_NODE_MINER_H
+#define BITCOIN_NODE_MINER_H
#include <primitives/block.h>
#include <txmempool.h>
-#include <validation.h>
#include <memory>
#include <optional>
#include <stdint.h>
-#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index_container.hpp>
+class ChainstateManager;
class CBlockIndex;
class CChainParams;
class CScript;
@@ -205,4 +205,4 @@ int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParam
/** Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed */
void RegenerateCommitments(CBlock& block, ChainstateManager& chainman);
-#endif // BITCOIN_MINER_H
+#endif // BITCOIN_NODE_MINER_H
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 9e2b1ab07e..89abdd057c 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -13,9 +13,9 @@
#include <deploymentinfo.h>
#include <deploymentstatus.h>
#include <key_io.h>
-#include <miner.h>
#include <net.h>
#include <node/context.h>
+#include <node/miner.h>
#include <policy/fees.h>
#include <pow.h>
#include <rpc/blockchain.h>
diff --git a/src/test/blockfilter_index_tests.cpp b/src/test/blockfilter_index_tests.cpp
index 2eb653e9ec..7d50def509 100644
--- a/src/test/blockfilter_index_tests.cpp
+++ b/src/test/blockfilter_index_tests.cpp
@@ -6,7 +6,7 @@
#include <chainparams.h>
#include <consensus/validation.h>
#include <index/blockfilterindex.h>
-#include <miner.h>
+#include <node/miner.h>
#include <pow.h>
#include <script/standard.h>
#include <test/util/blockfilter.h>
diff --git a/src/test/fuzz/tx_pool.cpp b/src/test/fuzz/tx_pool.cpp
index 752e882608..ac1fb657f1 100644
--- a/src/test/fuzz/tx_pool.cpp
+++ b/src/test/fuzz/tx_pool.cpp
@@ -3,7 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <consensus/validation.h>
-#include <miner.h>
+#include <node/miner.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp
index 7f44dcf20e..bdc6ff6130 100644
--- a/src/test/miner_tests.cpp
+++ b/src/test/miner_tests.cpp
@@ -7,7 +7,7 @@
#include <consensus/consensus.h>
#include <consensus/merkle.h>
#include <consensus/tx_verify.h>
-#include <miner.h>
+#include <node/miner.h>
#include <policy/policy.h>
#include <script/standard.h>
#include <txmempool.h>
diff --git a/src/test/util/mining.cpp b/src/test/util/mining.cpp
index f6a11bc02e..8b9069bea3 100644
--- a/src/test/util/mining.cpp
+++ b/src/test/util/mining.cpp
@@ -7,8 +7,8 @@
#include <chainparams.h>
#include <consensus/merkle.h>
#include <key_io.h>
-#include <miner.h>
#include <node/context.h>
+#include <node/miner.h>
#include <pow.h>
#include <script/standard.h>
#include <test/util/script.h>
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp
index 5a0c8e152a..cdb8238095 100644
--- a/src/test/util/setup_common.cpp
+++ b/src/test/util/setup_common.cpp
@@ -13,9 +13,9 @@
#include <crypto/sha256.h>
#include <init.h>
#include <interfaces/chain.h>
-#include <miner.h>
#include <net.h>
#include <net_processing.h>
+#include <node/miner.h>
#include <noui.h>
#include <policy/fees.h>
#include <pow.h>
diff --git a/src/test/validation_block_tests.cpp b/src/test/validation_block_tests.cpp
index 54873ce6fa..3efa74fcc3 100644
--- a/src/test/validation_block_tests.cpp
+++ b/src/test/validation_block_tests.cpp
@@ -7,7 +7,7 @@
#include <chainparams.h>
#include <consensus/merkle.h>
#include <consensus/validation.h>
-#include <miner.h>
+#include <node/miner.h>
#include <pow.h>
#include <random.h>
#include <script/standard.h>
diff --git a/test/sanitizer_suppressions/ubsan b/test/sanitizer_suppressions/ubsan
index 79a4eba1fc..6032fe496f 100644
--- a/test/sanitizer_suppressions/ubsan
+++ b/test/sanitizer_suppressions/ubsan
@@ -88,7 +88,7 @@ implicit-signed-integer-truncation:chain.h
implicit-signed-integer-truncation:crypto/
implicit-signed-integer-truncation:cuckoocache.h
implicit-signed-integer-truncation:leveldb/
-implicit-signed-integer-truncation:miner.cpp
+implicit-signed-integer-truncation:node/miner.cpp
implicit-signed-integer-truncation:net.cpp
implicit-signed-integer-truncation:net_processing.cpp
implicit-signed-integer-truncation:streams.h