fn process_transactions(
        bank: &Bank,
        transactions: &[Transaction],
        poh: &Arc<Mutex<PohRecorder>>,
    ) -> Result<(usize, Vec<usize>)> {
        let mut chunk_start = 0;
        let mut unprocessed_txs = vec![];
        while chunk_start != transactions.len() {
            let chunk_end = chunk_start
                + entryInfo::num_will_fit(
                    &transactions[chunk_start..],
                    packet::BLOB_DATA_SIZE as u64,
                    &Entry::serialized_to_blob_size,
                );

            let (result, unprocessed_txs_in_chunk) = Self::process_and_record_transactions(
                bank,
                &transactions[chunk_start..chunk_end],
                poh,
                chunk_start,
            );
            trace!("process_transactions: {:?}", result);
            unprocessed_txs.extend_from_slice(&unprocessed_txs_in_chunk);
            if let Err(Error::PohRecorderError(PohRecorderError::MaxHeightReached)) = result {
                // info!(
                //     "{}",
                //     Info(format!("process transactions: max height reached slot: {} height: {}",
                //     bank.slot(),
                //     bank.tick_height()).to_string())
                // );
                let loginfo: String = format!("process transactions: max height reached slot: {} height: {}",
                    bank.slot(),
                    bank.tick_height()).to_string();
                println!("{}",
                    printLn(
                        loginfo,
                        module_path!().to_string()
                    )
                );
                let range: Vec<usize> = (chunk_start..chunk_end).collect();
                unprocessed_txs.extend_from_slice(&range);
                unprocessed_txs.sort_unstable();
                unprocessed_txs.dedup();
                break;
            }
            result?;
            chunk_start = chunk_end;
        }
        Ok((chunk_start, unprocessed_txs))
    }
/// Sends transactions to the bank.
///
/// Returns the number of transactions successfully processed by the bank, which may be less
/// than the total number if max PoH height was reached and the bank halted
Sends transactions to the bank.
Returns the number of transactions successfully processed by the bank, which may be less
than the total number if max PoH height was reached and the bank halted
Sends transactions to the bank . Returns the number of transactions successfully processed by the bank which may be less than the total number if max PoH height was reached and the bank halted
fn process_transactions(
        bank: &Bank,
        transactions: &[Transaction],
        poh: &Arc<Mutex<PohRecorder>>,
    ) -> Result<(usize, Vec<usize>)> {
        let mut chunk_start = 0;
        let mut unprocessed_txs = vec![];
        while chunk_start != transactions.len() {
            let chunk_end = chunk_start
                + entryInfo::num_will_fit(
                    &transactions[chunk_start..],
                    packet::BLOB_DATA_SIZE as u64,
                    &Entry::serialized_to_blob_size,
                );
            let (result, unprocessed_txs_in_chunk) = Self::process_and_record_transactions(
                bank,
                &transactions[chunk_start..chunk_end],
                poh,
                chunk_start,
            );
            trace!("process_transactions: {:?}", result);
            unprocessed_txs.extend_from_slice(&unprocessed_txs_in_chunk);
            if let Err(Error::PohRecorderError(PohRecorderError::MaxHeightReached)) = result {
                // info!(
                //     "{}",
                //     Info(format!("process transactions: max height reached slot: {} height: {}",
                //     bank.slot(),
                //     bank.tick_height()).to_string())
                // );
                let loginfo: String = format!("process transactions: max height reached slot: {} height: {}",
                    bank.slot(),
                    bank.tick_height()).to_string();
                println!("{}",
                    printLn(
                        loginfo,
                        module_path!().to_string()
                    )
                );
                let range: Vec<usize> = (chunk_start..chunk_end).collect();
                unprocessed_txs.extend_from_slice(&range);
                unprocessed_txs.sort_unstable();
                unprocessed_txs.dedup();
                break;
            }
            result?;
            chunk_start = chunk_end;
        }
        Ok((chunk_start, unprocessed_txs))
    }
fn process_transactions ( bank : & Bank , transactions : & [ Transaction ] , poh : & Arc < Mutex < PohRecorder > > , ) -> Result < ( usize , Vec < usize > ) > { let mut chunk_start = 0 ; let mut unprocessed_txs = vec ! [ ] ; while chunk_start != transactions . len ( ) { let chunk_end = chunk_start + entryInfo :: num_will_fit ( & transactions [ chunk_start .. ] , packet :: BLOB_DATA_SIZE as u64 , & Entry :: serialized_to_blob_size , ) ; let ( result , unprocessed_txs_in_chunk ) = Self :: process_and_record_transactions ( bank , & transactions [ chunk_start .. chunk_end ] , poh , chunk_start , ) ; trace ! ( " " result ) ; unprocessed_txs . extend_from_slice ( & unprocessed_txs_in_chunk ) ; if let Err ( Error :: PohRecorderError ( PohRecorderError :: MaxHeightReached ) ) = result { // info!( //     "{}", //     Info(format!("process transactions: max height reached slot: {} height: {}", //     bank.slot(), //     bank.tick_height()).to_string()) // ); let loginfo : String = format ! ( " " bank slot ( ) bank tick_height ( ) ) . to_string ( ) ; println ! ( " " printLn ( loginfo module_path ( ) to_string ( ) ) ) ; let range : Vec < usize > = ( chunk_start .. chunk_end ) . collect ( ) ; unprocessed_txs . extend_from_slice ( & range ) ; unprocessed_txs . sort_unstable ( ) ; unprocessed_txs . dedup ( ) ; break ; } result ? ; chunk_start = chunk_end ; } Ok ( ( chunk_start , unprocessed_txs ) ) }
Sends transactions to the bank.
Sends transactions to the bank .
bank
&Bank
transactions
&[Transaction]
poh
&Arc<Mutex<PohRecorder>>
bank
&Bank
transactions
&[Transaction]
poh
&Arc<Mutex<PohRecorder>>