dht: Fix "good" node determination
This commit is contained in:
parent
6d05994c2c
commit
e4822769ee
@ -119,7 +119,13 @@ func (n *Node) Good() bool {
|
||||
if len(n.id) != 20 {
|
||||
return false
|
||||
}
|
||||
if time.Now().Sub(n.lastHeardFrom) >= 15*time.Minute {
|
||||
if n.lastSentTo.IsZero() {
|
||||
return true
|
||||
}
|
||||
if n.lastSentTo.Before(n.lastHeardFrom) {
|
||||
return true
|
||||
}
|
||||
if time.Now().Sub(n.lastHeardFrom) >= 1*time.Minute {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
Loading…
x
Reference in New Issue
Block a user