From 35051c756e148c7b61d26af1421ed133029bce12 Mon Sep 17 00:00:00 2001 From: asolana <110843012+ksolana@users.noreply.github.com> Date: Thu, 22 Aug 2024 08:24:08 -0700 Subject: [PATCH] Replace unbounded with bounded as single channel is used (#2646) We need the receiver to hold just one message so there is no need to have an unbounded channel. --- poh/src/poh_recorder.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/poh/src/poh_recorder.rs b/poh/src/poh_recorder.rs index 3fe76d5274bcf8..8b95ecec039d64 100644 --- a/poh/src/poh_recorder.rs +++ b/poh/src/poh_recorder.rs @@ -14,7 +14,9 @@ use solana_ledger::genesis_utils::{create_genesis_config, GenesisConfigInfo}; use { crate::{leader_bank_notifier::LeaderBankNotifier, poh_service::PohService}, - crossbeam_channel::{unbounded, Receiver, RecvTimeoutError, SendError, Sender, TrySendError}, + crossbeam_channel::{ + bounded, unbounded, Receiver, RecvTimeoutError, SendError, Sender, TrySendError, + }, log::*, solana_entry::{ entry::{hash_transactions, Entry}, @@ -207,7 +209,7 @@ impl TransactionRecorder { transactions: Vec, ) -> Result> { // create a new channel so that there is only 1 sender and when it goes out of scope, the receiver fails - let (result_sender, result_receiver) = unbounded(); + let (result_sender, result_receiver) = bounded(1); let res = self.record_sender .send(Record::new(mixin, transactions, bank_slot, result_sender));