Skip to content

Commit

Permalink
p2p, swarm/network/kademlia: use IsZero to check for zero time (#15603)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas authored and fjl committed Dec 4, 2017
1 parent 43dd8e6 commit 1d06e41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p2p/dial.go
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion swarm/network/kademlia/kaddb.go
Expand Up @@ -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
Expand Down

0 comments on commit 1d06e41

Please sign in to comment.