Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Remove window service
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Apr 24, 2020
1 parent b409974 commit 7fd3b29
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions core/src/window_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use solana_metrics::{inc_new_counter_debug, inc_new_counter_error};
use solana_perf::packet::Packets;
use solana_rayon_threadlimit::get_thread_count;
use solana_runtime::bank::Bank;
use solana_sdk::{clock::Slot, packet::Packet, pubkey::Pubkey, timing::duration_as_ms};
use solana_sdk::{clock::Slot, pubkey::Pubkey, timing::duration_as_ms};
use solana_streamer::streamer::PacketSender;
use std::net::UdpSocket;
use std::sync::atomic::{AtomicBool, Ordering};
Expand Down Expand Up @@ -140,21 +140,6 @@ where
Ok(())
}

fn is_playable_slot(blockstore: &Arc<Blockstore>, slot: Slot, packet: &Packet) -> bool {
if let Some(status) = blockstore.get_slot_confirmation_status(slot) {
if status.is_dead() {
false
} else if let Some(_confirmed_blockhash) = status.confirmed_blockhash {
// TODO: confirm this shred is for the confirmed_blockhash
packet.meta.repair
} else {
true
}
} else {
true
}
}

fn recv_window<F>(
blockstore: &Arc<Blockstore>,
insert_shred_sender: &CrossbeamSender<Vec<Shred>>,
Expand Down Expand Up @@ -195,9 +180,7 @@ where
} else if let Ok(shred) =
Shred::new_from_serialized_shred(packet.data.to_vec())
{
if is_playable_slot(blockstore, shred.slot(), packet)
&& shred_filter(&shred, last_root)
{
if shred_filter(&shred, last_root) {
// Mark slot as dead if the current shred is on the boundary
// of max shreds per slot. However, let the current shred
// get retransmitted. It'll allow peer nodes to see this shred
Expand Down

0 comments on commit 7fd3b29

Please sign in to comment.