prysmaticlabs / prysm

Simplify Before or After call of time.Time GO-C4011
Style
Minor
a month agoa month old
suggestion: newChainStartLastUpdated.Before(oldChainStartLastUpdated)
 298
 299	newChainStartLastUpdated, err := p.ChainStateLastUpdated(id)
 300	require.NoError(t, err)
 301	if !newChainStartLastUpdated.After(oldChainStartLastUpdated) { 302		t.Errorf("Last updated did not increase: old %v new %v", oldChainStartLastUpdated, newChainStartLastUpdated)
 303	}
 304}
suggestion: time.Now().Before(peerData.NextValidTime)
 381	peerData := p.store.PeerDataGetOrCreate(pid)
 382
 383	// No need to add backoff period, if the previous one hasn't expired yet.
 384	if !time.Now().After(peerData.NextValidTime) { 385		return
 386	}
 387