diff --git a/bench-tps/src/bench.rs b/bench-tps/src/bench.rs index 58930b21224ac9..76a1f686bb48d1 100644 --- a/bench-tps/src/bench.rs +++ b/bench-tps/src/bench.rs @@ -951,7 +951,7 @@ fn do_tx_transfers( signatures_sender: Option, ) { let mut last_sent_time = timestamp(); - loop { + 'thread_loop: loop { if thread_batch_sleep_ms > 0 { sleep(Duration::from_millis(thread_batch_sleep_ms as u64)); } @@ -995,16 +995,13 @@ fn do_tx_transfers( } if let Some(signatures_sender) = &signatures_sender { - if signatures_sender - .send(TransactionInfoBatch { - signatures, - sent_at: Utc::now(), - compute_unit_prices, - }) - .is_err() - { - error!("Receiver has been dropped, stop sending transactions."); - break; + if let Err(error) = signatures_sender.send(TransactionInfoBatch { + signatures, + sent_at: Utc::now(), + compute_unit_prices, + }) { + error!("Receiver has been dropped with error `{error}`, stop sending transactions."); + break 'thread_loop; } }