2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-11 13:11:12 +00:00

loopd/daemon: handle proxy error

Check returned error to make linter happy.
This commit is contained in:
Johan T. Halseth 2020-01-03 14:01:31 +01:00
parent 2334816a59
commit 391ae9dc6b
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

View File

@ -103,7 +103,15 @@ func daemon(config *config) error {
} }
defer restListener.Close() defer restListener.Close()
proxy := &http.Server{Handler: mux} proxy := &http.Server{Handler: mux}
go proxy.Serve(restListener)
go func() {
err := proxy.Serve(restListener)
// ErrServerClosed is always returned when the proxy is shut
// down, so don't log it.
if err != nil && err != http.ErrServerClosed {
log.Error(err)
}
}()
statusChan := make(chan loop.SwapInfo) statusChan := make(chan loop.SwapInfo)