mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 15:39:05 +01:00
net: Consistently use GetTimeMicros() for inactivity checks
The use of mocktime in test logic means that comparisons between GetTime() and GetTimeMicros()/1000000 are unreliable since the former can use mocktime values while the latter always gets the system clock; this changes the networking code's inactivity checks to consistently use the system clock for inactivity comparisons. Also remove some hacks from setmocktime() that are no longer needed, now that we're using the system clock for nLastSend and nLastRecv.
This commit is contained in:
@@ -46,6 +46,11 @@ int64_t GetTimeMicros()
|
||||
return now;
|
||||
}
|
||||
|
||||
int64_t GetSystemTimeInSeconds()
|
||||
{
|
||||
return GetTimeMicros()/1000000;
|
||||
}
|
||||
|
||||
/** Return a time useful for the debug log */
|
||||
int64_t GetLogTimeMicros()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user