eliminate periodic 'tick' in connection_maker

checkStateAndAttemptConnections already performs a full scan of all
potential targets, from which we can easily determine the nearest
future time (or, rather, its duration from now) on which an attempt is
due.

We also need to kick the ConnectionMaker into action when we receive a
topology update containing new connections.
This commit is contained in:
Matthias Radestock committed 2014-09-22 23:15:54 +01:00
1 parent d5e797f695
commit eecaa567fc
2 files changed
+26 -16

No files matched your search

+4
View File
@@ -77,6 +77,10 @@ func (cache *PeerCache) ApplyUpdate(update []byte, router *Router) ([]byte, erro
// Don't need to hold cache lock any longer
cache.Unlock()
if len(newUpdate) > 0 {
router.ConnectionMaker.Refresh()
}
return encodePeersMap(newUpdate), nil
}