aboutsummaryrefslogtreecommitdiff
path: root/hotline/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'hotline/server.go')
-rw-r--r--hotline/server.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/hotline/server.go b/hotline/server.go
index e28ff9a..1aa9b1a 100644
--- a/hotline/server.go
+++ b/hotline/server.go
@@ -152,8 +152,8 @@ func (s *Server) sendTransaction(t Transaction) error {
}
s.mux.Lock()
- defer s.mux.Unlock()
client := s.Clients[uint16(clientID)]
+ s.mux.Unlock()
if client == nil {
return fmt.Errorf("invalid client id %v", *t.clientID)
}
@@ -163,7 +163,8 @@ func (s *Server) sendTransaction(t Transaction) error {
return err
}
- if _, err := client.Connection.Write(b); err != nil {
+ _, err = client.Connection.Write(b)
+ if err != nil {
return err
}