aboutsummaryrefslogtreecommitdiff
path: root/cmd/dendrite-demo-yggdrasil/yggconn/session.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-06-11 13:08:11 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2020-06-11 13:08:11 +0100
commit89d61c487751e4beca71d396d719758ae4a98332 (patch)
tree83974e64ee40a6b99ac5ca409b97ae0105353ac5 /cmd/dendrite-demo-yggdrasil/yggconn/session.go
parentce2517b9fb70403d1dbeb52194ccd55122f8ed14 (diff)
Fix tiebreak in Yggdrasil demo (uses wrong key)
Diffstat (limited to 'cmd/dendrite-demo-yggdrasil/yggconn/session.go')
-rw-r--r--cmd/dendrite-demo-yggdrasil/yggconn/session.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/dendrite-demo-yggdrasil/yggconn/session.go b/cmd/dendrite-demo-yggdrasil/yggconn/session.go
index 8d96a9cb..c50b6b73 100644
--- a/cmd/dendrite-demo-yggdrasil/yggconn/session.go
+++ b/cmd/dendrite-demo-yggdrasil/yggconn/session.go
@@ -42,7 +42,7 @@ func (n *Node) listenFromYgg() {
var session *yamux.Session
// If the remote address is lower than ours then we'll be the
// server. Otherwse we'll be the client.
- if strings.Compare(conn.RemoteAddr().String(), n.DerivedServerName()) < 0 {
+ if strings.Compare(conn.RemoteAddr().String(), n.DerivedSessionName()) < 0 {
session, err = yamux.Server(conn, n.yamuxConfig())
} else {
session, err = yamux.Client(conn, n.yamuxConfig())
@@ -105,7 +105,7 @@ func (n *Node) DialContext(ctx context.Context, network, address string) (net.Co
}
// If the remote address is lower than ours then we will be the
// server. Otherwise we'll be the client.
- if strings.Compare(conn.RemoteAddr().String(), n.DerivedServerName()) < 0 {
+ if strings.Compare(conn.RemoteAddr().String(), n.DerivedSessionName()) < 0 {
session, err = yamux.Server(conn, n.yamuxConfig())
} else {
session, err = yamux.Client(conn, n.yamuxConfig())