This commit is contained in:
Neil Alexander 2020-08-05 16:08:58 +01:00
parent e2cd600fde
commit ae827fbe62
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 2 additions and 2 deletions

View file

@ -127,7 +127,7 @@ func Setup(instanceName, storageDirectory string) (*Node, error) {
MaxIncomingUniStreams: 0,
KeepAlive: true,
MaxIdleTimeout: time.Minute * 30,
HandshakeTimeout: time.Second * 30,
HandshakeTimeout: time.Second * 15,
}
n.log.Println("Public curve25519:", n.core.EncryptionPublicKey())

View file

@ -109,6 +109,7 @@ func (n *Node) DialContext(ctx context.Context, network, address string) (net.Co
if v, ok := n.coords.Load(address); ok {
coords, ok := v.(yggdrasil.Coords)
if !ok {
n.coords.Delete(address)
return nil, errors.New("should have found yggdrasil.Coords but didn't")
}
n.log.Infof("Coords %s for %q cached, trying to dial", coords.String(), address)
@ -132,7 +133,6 @@ func (n *Node) DialContext(ctx context.Context, network, address string) (net.Co
// know about from our direct switch peers.
for _, peer := range n.core.GetSwitchPeers() {
if peer.PublicKey.String() == address {
fmt.Println("*", peer.PublicKey.String(), address)
coords = peer.Coords
n.log.Infof("%q is a direct peer, coords are %s", address, coords.String())
n.coords.Store(address, coords)