Skip to content

Commit b88528a

Browse files
committed
Update timeout for tx submission
1 parent 967887e commit b88528a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

services/requester/batch_tx_pool.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,20 +302,17 @@ func (t *BatchTxPool) submitSingleTransaction(
302302
done := make(chan struct{})
303303
var submitError error
304304

305-
// This method is called while holding the `t.txMux` lock.
306-
// Do not let it run for a long time, to avoid lock-contention.
307-
// The 4-second timeout provides a 1-second buffer on top of ANs
305+
// The 5-second timeout provides a 2-second buffer on top of ANs
308306
// 3-second timeout for LN requests.
309-
ctx, cancel := context.WithTimeout(ctx, time.Second*4)
307+
ctx, cancel := context.WithTimeout(ctx, time.Second*5)
310308
defer cancel()
311309

312310
// Build & submit the transaction, in a separate goroutine. The AN calls
313311
// do not respect the `context.WithTimeout` deadline, and can run for as
314312
// long as is necessary for their completion.
315313
// `context.WithTimeout` arranges for Done to be closed when the specified
316314
// timeout elapses, and at that point we return an error to abort the
317-
// transaction submission, and release the `t.txMux` lock for the next
318-
// requests.
315+
// transaction submission.
319316
go func() {
320317
defer close(done)
321318

0 commit comments

Comments
 (0)