p2p/discover: deflake UDP tests

This commit is contained in:
Felix Lange
2015-02-09 11:02:32 +01:00
parent 028775a086
commit 9915d3c3be
4 changed files with 129 additions and 65 deletions

View File

@ -87,9 +87,10 @@ func (tab *Table) Lookup(target NodeID) []*Node {
reply = make(chan []*Node, alpha)
pendingQueries = 0
)
// don't query further if we hit the target.
// don't query further if we hit the target or ourself.
// unlikely to happen often in practice.
asked[target] = true
asked[tab.self.ID] = true
tab.mutex.Lock()
// update last lookup stamp (for refresh logic)