Commit e49b0068 authored by Michael de Hoog's avatar Michael de Hoog

Fix deadlock

parent 29a00c95
...@@ -88,11 +88,14 @@ func (q *Queue[T]) sendTx(ctx context.Context, id T, candidate TxCandidate, rece ...@@ -88,11 +88,14 @@ func (q *Queue[T]) sendTx(ctx context.Context, id T, candidate TxCandidate, rece
q.pendingChanged(q.pending.Add(^uint64(0))) // -1 q.pendingChanged(q.pending.Add(^uint64(0))) // -1
}() }()
receipt, err := q.txMgr.Send(ctx, candidate) receipt, err := q.txMgr.Send(ctx, candidate)
go func() {
// notify from a goroutine to ensure the receipt channel won't block method completion
receiptCh <- TxReceipt[T]{ receiptCh <- TxReceipt[T]{
ID: id, ID: id,
Receipt: receipt, Receipt: receipt,
Err: err, Err: err,
} }
}()
return err return err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment