server: properly unlock within openchannel if peer not found

This commit is contained in:
Olaoluwa Osuntokun 2018-08-18 18:17:55 -07:00
parent 147596047f
commit 3f5ec99330
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -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
}