From d4368e059cfe09d973a238d08cbe6812511366d3 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Thu, 4 Dec 2025 14:10:20 +0100 Subject: [PATCH] move-only: add node/mining_types.h Move mining related structs there. This simplifies includes in later commits and makes the code easier to understand for Mining IPC client developers. --- src/interfaces/mining.h | 4 +- src/node/miner.h | 1 + src/node/mining_types.h | 151 ++++++++++++++++++++++++++++++++++++++++ src/node/types.h | 129 ---------------------------------- src/test/util/mining.h | 2 +- 5 files changed, 154 insertions(+), 133 deletions(-) create mode 100644 src/node/mining_types.h diff --git a/src/interfaces/mining.h b/src/interfaces/mining.h index 943d34e75d9..ca4f73813b9 100644 --- a/src/interfaces/mining.h +++ b/src/interfaces/mining.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -22,9 +23,6 @@ namespace node { struct NodeContext; } // namespace node -class BlockValidationState; -class CScript; - namespace interfaces { //! Block template interface diff --git a/src/node/miner.h b/src/node/miner.h index 5c8668771f5..c5d21cfc322 100644 --- a/src/node/miner.h +++ b/src/node/miner.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/src/node/mining_types.h b/src/node/mining_types.h new file mode 100644 index 00000000000..69088bb7187 --- /dev/null +++ b/src/node/mining_types.h @@ -0,0 +1,151 @@ +// Copyright (c) The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +//! @file node/mining_types.h is used externally by mining IPC clients, so it should +//! only declare simple data definitions. +//! +//! Avoid declaring functions or classes with methods here unless they are +//! header-only or provided by the util library. + +#ifndef BITCOIN_NODE_MINING_TYPES_H +#define BITCOIN_NODE_MINING_TYPES_H + +#include +#include +#include +#include +#include