Kick off the first connection attempt to each peer using ConnectionMaker instead of calling CreateConnection directly.

This commit is contained in:
Bryan Boreham committed 2014-09-05 11:11:38 +01:00
1 parent acfefed142
commit a5be96d35f
1 file changed
+1 -6
+1 -6
View File
@@ -124,12 +124,7 @@ func main() {
router := weave.NewRouter(iface, ourName, []byte(password), connLimit, bufSz*1024*1024, logFrame)
router.Start()
for _, peer := range peers {
targetPeer := peer
go func() {
if err := router.Ourself.CreateConnection(targetPeer, weave.UnknownPeerName); err != nil {
log.Println(err)
}
}()
router.ConnectionMaker.EnsureConnection(weave.UnknownPeerName, peer)
}
go handleHttp(router)
handleSignals(router)