mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
p2p: Make timeout mockable and type safe, speed up test
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user