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
q.pendingChanged(q.pending.Add(^uint64(0))) // -1
}()
receipt, err := q.txMgr.Send(ctx, candidate)
receiptCh <- TxReceipt[T]{
ID: id,
Receipt: receipt,
Err: err,
}
go func() {
// notify from a goroutine to ensure the receipt channel won't block method completion
receiptCh <- TxReceipt[T]{
ID: id,
Receipt: receipt,
Err: 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