Skip to content

Commit

Permalink
tapgarden: pre proof retrieval delay respects context done signal
Browse files Browse the repository at this point in the history
  • Loading branch information
ffranr committed Sep 20, 2023
1 parent 4ee966a commit fbc0028
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tapgarden/custodian.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,14 @@ func (c *Custodian) inspectWalletTx(walletTx *lndclient.Transaction) error {

// Sleep to give the sender an opportunity to transfer
// the proof to the proof courier service.
time.Sleep(defaultProofRetrievalDelay)
// Without this delay our first attempt at retrieving
// the proof will very likely fail. We should expect
// retrieval success before this delay.
select {
case <-time.After(defaultProofRetrievalDelay):
case <-ctx.Done():
return
}

// Attempt to receive proof via proof courier service.
loc := proof.Locator{
Expand Down

0 comments on commit fbc0028

Please sign in to comment.