diff --git a/loopd/swapclient_server.go b/loopd/swapclient_server.go index a76bc32b..2d4eb348 100644 --- a/loopd/swapclient_server.go +++ b/loopd/swapclient_server.go @@ -785,10 +785,13 @@ func (s *swapClientServer) SwapInfo(ctx context.Context, // Just return the server's in-memory cache here too as we also want to // return temporary failures to the client. + s.swapsLock.Lock() swp, ok := s.swaps[swapHash] + s.swapsLock.Unlock() if !ok { return nil, fmt.Errorf("swap with hash %s not found", req.Id) } + return s.marshallSwap(ctx, &swp) }