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:
Suhas Daftuar
2017-01-19 13:01:18 -05:00
parent 054d664215
commit 99464bc38e
5 changed files with 28 additions and 18 deletions

View File

@@ -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()
{