Skip to content

Commit

Permalink
Allow context cancelations for backlogged sequencer txs
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower authored and hkalodner committed Apr 7, 2022
1 parent 98754a4 commit 0b690fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arbnode/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,17 @@ func NewSequencer(txStreamer *TransactionStreamer, l1Client arbutil.L1Interface,

func (s *Sequencer) PublishTransaction(ctx context.Context, tx *types.Transaction) error {
resultChan := make(chan error, 1)
s.txQueue <- txQueueItem{
queueItem := txQueueItem{
tx,
resultChan,
ctx,
}
select {
case s.txQueue <- queueItem:
case <-ctx.Done():
return ctx.Err()
}
select {
case res := <-resultChan:
return res
case <-ctx.Done():
Expand Down

0 comments on commit 0b690fb

Please sign in to comment.