aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-04-03 14:20:35 +0100
committerfanquake <fanquake@gmail.com>2023-04-03 14:41:22 +0100
commit369d4c03b7084de967576759545ba36a17fc18bb (patch)
treecb7bb80bbf2f3d56a0cc38deb93e4e0276b0d7f7 /src/rpc
parent5150e280103dd41c8a438ce72359b0f25ff23a2f (diff)
parent00e9b97f37e0bdf4c647236838c10b68b7ad5be3 (diff)
downloadbitcoin-369d4c03b7084de967576759545ba36a17fc18bb.tar.xz
Merge bitcoin/bitcoin#27254: refactor: Extract util/fs from util/system
00e9b97f37e0bdf4c647236838c10b68b7ad5be3 refactor: Move fs.* to util/fs.* (TheCharlatan) 106b46d9d25b5228ef009fbbe6f9a7ae35090d15 Add missing fs.h includes (TheCharlatan) b202b3dd6393b415fa68e18dc49c9431dc6b58b2 Add missing cstddef include in assumptions.h (TheCharlatan) 18fb36367a28819bd5ab402344802796a1248979 refactor: Extract util/fs_helpers from util/system (Ben Woosley) Pull request description: This pull request is part of the `libbitcoinkernel` project https://github.com/bitcoin/bitcoin/issues/24303 https://github.com/bitcoin/bitcoin/projects/18 and more specifically its "Step 2: Decouple most non-consensus code from libbitcoinkernel". This commit was originally authored by empact and is taken from its parent PR #25152. #### Context There is an ongoing effort to decouple the `ArgsManager` used for command line parsing user-provided arguments from the libbitcoinkernel library (https://github.com/bitcoin/bitcoin/pull/25290, https://github.com/bitcoin/bitcoin/pull/25487, https://github.com/bitcoin/bitcoin/pull/25527, https://github.com/bitcoin/bitcoin/pull/25862, https://github.com/bitcoin/bitcoin/pull/26177, and https://github.com/bitcoin/bitcoin/pull/27125). The `ArgsManager` is defined in `system.h`. A similar pull request extracting functionality from `system.h` has been merged in https://github.com/bitcoin/bitcoin/pull/27238. #### Changes Next to providing better code organization, this PR removes some reliance of the tree of libbitcoinkernel header includes on `system.h` (and thus the `ArgsManager` definition) by moving filesystem related functions out of the `system.*` files. There is already a pair of `fs.h` / `fs.cpp` in the top-level `src/` directory. They were not combined with the files introduced here, to keep the patch cleaner and more importantly because they are often included without the utility functions. The new files are therefore named `fs_helpers` and the existing `fs` files are moved into the util directory. Further commits splitting more functionality out of `system.h` are still in #25152 and will be submitted in separate PRs once this PR has been processed. ACKs for top commit: hebasto: ACK 00e9b97f37e0bdf4c647236838c10b68b7ad5be3 Tree-SHA512: 31422f148d14ba3c843b99b1550a6fd77c77f350905ca324f93d4f97b652246bc58fa9696c64d1201979cf88733e40be02d262739bb7d417cf22bf506fdb7666
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/blockchain.cpp2
-rw-r--r--src/rpc/blockchain.h2
-rw-r--r--src/rpc/mempool.cpp2
-rw-r--r--src/rpc/request.cpp5
4 files changed, 6 insertions, 5 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 1a9b265fbe..fb22321d90 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -15,7 +15,6 @@
#include <core_io.h>
#include <deploymentinfo.h>
#include <deploymentstatus.h>
-#include <fs.h>
#include <hash.h>
#include <index/blockfilterindex.h>
#include <index/coinstatsindex.h>
@@ -39,6 +38,7 @@
#include <undo.h>
#include <univalue.h>
#include <util/check.h>
+#include <util/fs.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/translation.h>
diff --git a/src/rpc/blockchain.h b/src/rpc/blockchain.h
index 9ccb87b78a..0a86085db0 100644
--- a/src/rpc/blockchain.h
+++ b/src/rpc/blockchain.h
@@ -7,9 +7,9 @@
#include <consensus/amount.h>
#include <core_io.h>
-#include <fs.h>
#include <streams.h>
#include <sync.h>
+#include <util/fs.h>
#include <validation.h>
#include <any>
diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp
index 3a69e2d8a2..927b4ce1fc 100644
--- a/src/rpc/mempool.cpp
+++ b/src/rpc/mempool.cpp
@@ -9,7 +9,6 @@
#include <chainparams.h>
#include <core_io.h>
-#include <fs.h>
#include <kernel/mempool_entry.h>
#include <node/mempool_persist_args.h>
#include <policy/rbf.h>
@@ -21,6 +20,7 @@
#include <script/standard.h>
#include <txmempool.h>
#include <univalue.h>
+#include <util/fs.h>
#include <util/moneystr.h>
#include <util/time.h>
diff --git a/src/rpc/request.cpp b/src/rpc/request.cpp
index b6ef1909c9..4c5ccbbdad 100644
--- a/src/rpc/request.cpp
+++ b/src/rpc/request.cpp
@@ -5,12 +5,13 @@
#include <rpc/request.h>
-#include <fs.h>
+#include <util/fs.h>
#include <random.h>
#include <rpc/protocol.h>
-#include <util/system.h>
+#include <util/fs_helpers.h>
#include <util/strencodings.h>
+#include <util/system.h>
#include <fstream>
#include <stdexcept>