mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-11 08:07:33 +02:00
rpc: make uptime monotonic across NTP jumps
Compute `uptime` from `SteadyClock` so it is unaffected by system time changes after startup.
Derive GUI startup time by subtracting the monotonic uptime from the wall clock time.
Add a functional test covering a large `setmocktime` jump.
Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
This commit is contained in:
@@ -210,7 +210,7 @@ bool ClientModel::isReleaseVersion() const
|
||||
|
||||
QString ClientModel::formatClientStartupTime() const
|
||||
{
|
||||
return QDateTime::fromSecsSinceEpoch(GetStartupTime()).toString();
|
||||
return QDateTime::currentDateTime().addSecs(-TicksSeconds(GetUptime())).toString();
|
||||
}
|
||||
|
||||
QString ClientModel::dataDir() const
|
||||
|
||||
Reference in New Issue
Block a user