aboutsummaryrefslogtreecommitdiff
path: root/src/init/common.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-23 10:02:39 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-04-23 10:02:50 +0200
commit66fd3b28e85c167f3955b5603496daf8d91abcad (patch)
treee070e332b8d91d2c58fb91cda864ff4e198adbb1 /src/init/common.h
parent4b5659c6b115315c9fd2902b4edd4b960a5e066e (diff)
parent615965cfd1ef1e0627d69970d99bdfedb9176833 (diff)
downloadbitcoin-66fd3b28e85c167f3955b5603496daf8d91abcad.tar.xz
Merge bitcoin/bitcoin#21732: MOVEONLY: Move common init code to init/common
615965cfd1ef1e0627d69970d99bdfedb9176833 Move common package version code to init/common (Russell Yanofsky) 5bed2ab42c4f1a820468f7005ce62e39001f6611 Move common logging start code to init/common (Russell Yanofsky) 1fb7fcfa52569a652d3ea55c210b725e60b7d86f Move common logging GetArgs code to init/common (Russell Yanofsky) 90469c16906ab451bb1250df5e51563870a7ef3b Move common logging AddArg code to init/common (Russell Yanofsky) 387c4cf5887bfdaf1606e1b287d901e4c449514f Move common sanity check code to init/common (Russell Yanofsky) a67b54855b294802d52f09fa60d3f63550cbada7 Move common global init code to init/common (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- This change is move-only and can be easily reviewed with `--color-moved=dimmed_zebra`. The moves are needed to avoid duplicating common init code between different binaries (`bitcoin-node`, `bitcoin-wallet`, etc) in #10102. In #10102, each binary has it's own init file (`src/init/bitcoin-node.cpp`, `src/init/bitcoin-wallet.cpp`) so this PR moves the common code to `src/init/common.cpp`. ACKs for top commit: MarcoFalke: review ACK 615965cfd1ef1e0627d69970d99bdfedb9176833 🖱 practicalswift: cr ACK 615965cfd1ef1e0627d69970d99bdfedb9176833: dimmed zebra looks correct Tree-SHA512: 859e1d86aee17eb50a49d806cf62d30d12f6b15018e41c096da41d7e535a9d2d088481cb340fee59e6c68e512a74b61c7146f2683465f553dc4953bf32f2a7b4
Diffstat (limited to 'src/init/common.h')
-rw-r--r--src/init/common.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/init/common.h b/src/init/common.h
new file mode 100644
index 0000000000..fc4bc1b280
--- /dev/null
+++ b/src/init/common.h
@@ -0,0 +1,28 @@
+// Copyright (c) 2021 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
+//! @brief Common init functions shared by bitcoin-node, bitcoin-wallet, etc.
+
+#ifndef BITCOIN_INIT_COMMON_H
+#define BITCOIN_INIT_COMMON_H
+
+class ArgsManager;
+
+namespace init {
+void SetGlobals();
+void UnsetGlobals();
+/**
+ * Ensure a usable environment with all
+ * necessary library support.
+ */
+bool SanityChecks();
+void AddLoggingArgs(ArgsManager& args);
+void SetLoggingOptions(const ArgsManager& args);
+void SetLoggingCategories(const ArgsManager& args);
+bool StartLogging(const ArgsManager& args);
+void LogPackageVersion();
+} // namespace init
+
+#endif // BITCOIN_INIT_COMMON_H