Merge pull request #184 from bboreham/182_unstable_connections

Extra check for duplicate connection

Fixes #182.
This commit is contained in:
rade committed 2014-11-14 14:46:46 +00:00
commit 3cc7b383ad
1 file changed
+3
+3
View File
@@ -345,6 +345,9 @@ func (conn *LocalConnection) handshake(acceptNewPeer bool) error {
return fmt.Errorf("Found unknown remote name: %s at %s", name, conn.remoteTCPAddr)
}
}
if existingConn, found := conn.local.ConnectionTo(name); found && existingConn.Established() {
return fmt.Errorf("Already have connection to %s at %s", name, existingConn.RemoteTCPAddr())
}
uidStr, err := checkHandshakeStringField("UID", "", handshakeRecv)
if err != nil {