p2p, swarm/network/kademlia: use IsZero to check for zero time (#15603)

This commit is contained in:
ferhat elmas 2017-12-04 11:07:10 +01:00 committed by Felix Lange
parent 43dd8e62fc
commit 1d06e41f04
2 changed files with 2 additions and 2 deletions

View File

@ -157,7 +157,7 @@ func (s *dialstate) removeStatic(n *discover.Node) {
}
func (s *dialstate) newTasks(nRunning int, peers map[discover.NodeID]*Peer, now time.Time) []task {
if s.start == (time.Time{}) {
if s.start.IsZero() {
s.start = now
}

View File

@ -330,7 +330,7 @@ func (self *KadDb) load(path string, cb func(*NodeRecord, Node) error) (err erro
}
}
n++
if (node.After == time.Time{}) {
if node.After.IsZero() {
node.After = time.Now()
}
self.index[node.Addr] = node