aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-05-10 14:22:28 +0200
committerMacroFake <falke.marco@gmail.com>2022-05-11 16:39:23 +0200
commitfab9e8a29c2cdeab6cf1ae7c1fc0e0a3af783b17 (patch)
treeb0329cfdc3d5936b1b54b1947ccc411d01abe064 /src/bitcoin-cli.cpp
parent27d7b11e8ce25ebc79be5284d85cede263fa1362 (diff)
downloadbitcoin-fab9e8a29c2cdeab6cf1ae7c1fc0e0a3af783b17.tar.xz
Remove unused GetTimeSeconds
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index dea46693bc..88b0e86a36 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -9,23 +9,26 @@
#include <chainparamsbase.h>
#include <clientversion.h>
+#include <compat/stdin.h>
#include <policy/feerate.h>
#include <rpc/client.h>
#include <rpc/mining.h>
#include <rpc/protocol.h>
#include <rpc/request.h>
#include <tinyformat.h>
+#include <univalue.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/translation.h>
#include <util/url.h>
#include <algorithm>
+#include <chrono>
#include <cmath>
+#include <cstdio>
#include <functional>
#include <memory>
#include <optional>
-#include <stdio.h>
#include <string>
#include <tuple>
@@ -37,8 +40,11 @@
#include <event2/keyvalq_struct.h>
#include <support/events.h>
-#include <univalue.h>
-#include <compat/stdin.h>
+// The server returns time values from a mockable system clock, but it is not
+// trivial to get the mocked time from the server, nor is it needed for now, so
+// just use a plain system_clock.
+using CliClock = std::chrono::system_clock;
+using CliSeconds = std::chrono::time_point<CliClock, std::chrono::seconds>;
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
UrlDecodeFn* const URL_DECODE = urlDecode;
@@ -433,7 +439,7 @@ private:
if (conn_type == "addr-fetch") return "addr";
return "";
}
- const int64_t m_time_now{GetTimeSeconds()};
+ const int64_t m_time_now{count_seconds(Now<CliSeconds>())};
public:
static constexpr int ID_PEERINFO = 0;