aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-07-20 18:16:30 +0200
committerMacroFake <falke.marco@gmail.com>2022-10-18 14:07:59 +0200
commitfaf44876db555f7488c8df96db9fa88b793f897c (patch)
tree4db52179a2539d5ab6fcd7cf21a3ddeef2aed2f6 /src/node
parentba441d493ce6543c63c923596004b7ce0409cba2 (diff)
Move ::nMaxTipAge into ChainstateManager
Diffstat (limited to 'src/node')
-rw-r--r--src/node/chainstatemanager_args.cpp17
-rw-r--r--src/node/chainstatemanager_args.h16
2 files changed, 33 insertions, 0 deletions
diff --git a/src/node/chainstatemanager_args.cpp b/src/node/chainstatemanager_args.cpp
new file mode 100644
index 0000000000..05aba3d23e
--- /dev/null
+++ b/src/node/chainstatemanager_args.cpp
@@ -0,0 +1,17 @@
+// Copyright (c) 2022 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#include <node/chainstatemanager_args.h>
+
+#include <util/system.h>
+
+#include <chrono>
+#include <optional>
+
+namespace node {
+void ApplyArgsManOptions(const ArgsManager& args, ChainstateManager::Options& opts)
+{
+ if (auto value{args.GetIntArg("-maxtipage")}) opts.max_tip_age = std::chrono::seconds{*value};
+}
+} // namespace node
diff --git a/src/node/chainstatemanager_args.h b/src/node/chainstatemanager_args.h
new file mode 100644
index 0000000000..847ddefb8c
--- /dev/null
+++ b/src/node/chainstatemanager_args.h
@@ -0,0 +1,16 @@
+// Copyright (c) 2022 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef BITCOIN_NODE_CHAINSTATEMANAGER_ARGS_H
+#define BITCOIN_NODE_CHAINSTATEMANAGER_ARGS_H
+
+#include <validation.h>
+
+class ArgsManager;
+
+namespace node {
+void ApplyArgsManOptions(const ArgsManager& args, ChainstateManager::Options& opts);
+} // namespace node
+
+#endif // BITCOIN_NODE_CHAINSTATEMANAGER_ARGS_H