diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-07-10 18:19:11 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-12-06 10:47:52 +0100 |
commit | fadc0c80ae4e526fb2b503f7cc02f6122aaf1de5 (patch) | |
tree | fcae45e90b07fc8721022b9ef8b7e09cead39406 /src/qt/guiutil.cpp | |
parent | fa6d5a238d2c94440105ddd4f1554f85659d6c5b (diff) | |
download | bitcoin-fadc0c80ae4e526fb2b503f7cc02f6122aaf1de5.tar.xz |
p2p: Make timeout mockable and type safe, speed up test
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 4262866f32..35e4ab4ecd 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -20,6 +20,7 @@ #include <script/script.h> #include <script/standard.h> #include <util/system.h> +#include <util/time.h> #ifdef WIN32 #ifndef NOMINMAX @@ -705,8 +706,9 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction assert(false); } -QString formatDurationStr(int secs) +QString formatDurationStr(std::chrono::seconds dur) { + const auto secs = count_seconds(dur); QStringList strList; int days = secs / 86400; int hours = (secs % 86400) / 3600; |