From fa305fd92c0a5a91831be3ccec0a5ef962a5fbcb Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 8 Apr 2022 17:37:18 +0200 Subject: Add mockable clock type and TicksSinceEpoch helper --- src/bitcoin-cli.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/bitcoin-cli.cpp') 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; const std::function 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())}; + const int64_t time_now{TicksSinceEpoch(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()) { -- cgit v1.2.3