diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-04-08 17:37:18 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-05-18 18:58:05 +0200 |
commit | fa305fd92c0a5a91831be3ccec0a5ef962a5fbcb (patch) | |
tree | e718750f28eeb8a8775ce228059d561a03bd84f4 /src/bitcoin-cli.cpp | |
parent | 002411dc53753b52fef645484258e8baf41585a1 (diff) |
Add mockable clock type and TicksSinceEpoch helper
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r-- | src/bitcoin-cli.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 640643a695..cbbea3d8fa 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -44,7 +44,6 @@ // 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; @@ -470,7 +469,7 @@ public: if (networkinfo["version"].get_int() < 209900) { throw std::runtime_error("-netinfo requires bitcoind server to be running v0.21.0 and up"); } - const int64_t time_now{count_seconds(Now<CliSeconds>())}; + const int64_t time_now{TicksSinceEpoch<std::chrono::seconds>(CliClock::now())}; // Count peer connection totals, and if DetailsRequested(), store peer data in a vector of structs. for (const UniValue& peer : batch[ID_PEERINFO]["result"].getValues()) { |