mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
client: make ListSwaps thread safe
This commit is contained in:
parent
60661504a5
commit
62f654eef1
1 changed files with 3 additions and 0 deletions
|
|
@ -255,6 +255,9 @@ func (s *swapClientServer) ListSwaps(_ context.Context,
|
|||
err error
|
||||
)
|
||||
|
||||
s.swapsLock.Lock()
|
||||
defer s.swapsLock.Unlock()
|
||||
|
||||
// We can just use the server's in-memory cache as that contains the
|
||||
// most up-to-date state including temporary failures which aren't
|
||||
// persisted to disk. The swaps field is a map, that's why we need an
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue