From 7200a7ce09574224879f1fe090ede956e9842fa5 Mon Sep 17 00:00:00 2001 From: Gustavo Stingelin Date: Wed, 15 Jul 2026 14:20:45 -0300 Subject: [PATCH] loopd: synchronize cached swap lookups --- loopd/swapclient_server.go | 3 +++ 1 file changed, 3 insertions(+) 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) }