remove a wrapper function (#29305)

This commit is contained in:
Tao Zhu 2022-12-19 10:10:16 -06:00 committed by GitHub
parent cdb204114e
commit c657f42d77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 15 deletions

View File

@ -542,27 +542,14 @@ impl ThreadLocalUnprocessedPackets {
)
}
fn filter_forwardable_packets_and_add_batches(
&mut self,
bank: Arc<Bank>,
forward_packet_batches_by_accounts: &mut ForwardPacketBatchesByAccounts,
) -> FilterForwardingResults {
self.filter_and_forward_with_account_limits(
bank,
forward_packet_batches_by_accounts,
UNPROCESSED_BUFFER_STEP_SIZE,
)
}
/// Filter out packets that fail to sanitize, or are no longer valid (could be
/// too old, a duplicate of something already processed). Doing this in batches to avoid
/// checking bank's blockhash and status cache per transaction which could be bad for performance.
/// Added valid and sanitized packets to forwarding queue.
fn filter_and_forward_with_account_limits(
fn filter_forwardable_packets_and_add_batches(
&mut self,
bank: Arc<Bank>,
forward_buffer: &mut ForwardPacketBatchesByAccounts,
batch_size: usize,
) -> FilterForwardingResults {
let mut total_forwardable_tracer_packets: usize = 0;
let mut total_tracer_packets_in_buffer: usize = 0;
@ -582,7 +569,7 @@ impl ThreadLocalUnprocessedPackets {
new_priority_queue.extend(
original_priority_queue
.drain_desc()
.chunks(batch_size)
.chunks(UNPROCESSED_BUFFER_STEP_SIZE)
.into_iter()
.flat_map(|packets_to_process| {
// Only process packets not yet forwarded