mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loop: fix race in loopOutSwap.payInvoiceAsync
The function used to call the method swapKit.swapInfo() which accessed many fields of the swapKit which may change in parallel by handlePaymentResult called by executeSwap (payInvoiceAsync is called in a goroutine). The fields are: cost, state, and update time.
This commit is contained in:
parent
ce77fcc12c
commit
3cbfadd27a
1 changed files with 1 additions and 1 deletions
|
|
@ -873,7 +873,7 @@ func (s *loopOutSwap) payInvoiceAsync(ctx context.Context,
|
|||
}
|
||||
|
||||
if err := s.swapKit.server.ReportRoutingResult(
|
||||
ctx, s.swapInfo().SwapHash, s.swapInvoicePaymentAddr,
|
||||
ctx, s.hash, s.swapInvoicePaymentAddr,
|
||||
reportType, paymentSuccess, int32(attempts),
|
||||
dt.Milliseconds(),
|
||||
); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue