server: properly unlock within openchannel if peer not found

This commit is contained in:
Olaoluwa Osuntokun committed 2018-08-18 18:17:55 -07:00
1 parent 147596047f
commit 3f5ec99330
1 file changed
+2
+2
View File
@@ -2767,6 +2767,8 @@ func (s *server) OpenChannel(
s.mu.RLock()
peer, ok := s.peersByPub[string(pubKeyBytes)]
if !ok {
s.mu.RUnlock()
req.err <- fmt.Errorf("peer %x is not online", pubKeyBytes)
return req.updates, req.err
}