mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopd: synchronize cached swap lookups
This commit is contained in:
parent
34cf98e8e8
commit
7200a7ce09
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue