fix timeout test

This commit is contained in:
Callan Bryant 2020-03-06 22:52:33 +00:00
parent 9068c861f5
commit 503427031b
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

View File

@ -84,7 +84,7 @@ func GenerateReport(dev *wgtypes.Device, conf *DsnetConfig, oldReport *DsnetRepo
if !known {
status = StatusSyncRequired
} else if wgPeer.LastHandshakeTime.After(time.Now().Add(-TIMEOUT)) {
} else if time.Since(wgPeer.LastHandshakeTime) < TIMEOUT {
status = StatusOnline
// TODO same test but with rx byte data from last report (otherwise
// peer can fake online status by disabling handshake)