pub struct RoutingThread {Show 18 fields
pub blockchain_lock: Arc<RwLock<Blockchain>>,
pub mempool_lock: Arc<RwLock<Mempool>>,
pub sender_to_consensus: Sender<ConsensusEvent>,
pub sender_to_miner: Sender<MiningEvent>,
pub config_lock: Arc<RwLock<dyn Configuration + Send + Sync>>,
pub timer: Timer,
pub wallet_lock: Arc<RwLock<Wallet>>,
pub network: Network,
pub storage: Storage,
pub reconnection_timer: Timestamp,
pub peer_removal_timer: Timestamp,
pub peer_file_write_timer: Timestamp,
pub last_emitted_block_fetch_count: BlockId,
pub stats: RoutingStats,
pub senders_to_verification: Vec<Sender<VerifyRequest>>,
pub last_verification_thread_index: usize,
pub stat_sender: Sender<String>,
pub blockchain_sync_state: BlockchainSyncState,
}
Expand description
Manages peers and routes messages to correct controller
Fields§
§blockchain_lock: Arc<RwLock<Blockchain>>
§mempool_lock: Arc<RwLock<Mempool>>
§sender_to_consensus: Sender<ConsensusEvent>
§sender_to_miner: Sender<MiningEvent>
§config_lock: Arc<RwLock<dyn Configuration + Send + Sync>>
§timer: Timer
§wallet_lock: Arc<RwLock<Wallet>>
§network: Network
§storage: Storage
§reconnection_timer: Timestamp
§peer_removal_timer: Timestamp
§peer_file_write_timer: Timestamp
§last_emitted_block_fetch_count: BlockId
§stats: RoutingStats
§senders_to_verification: Vec<Sender<VerifyRequest>>
§last_verification_thread_index: usize
§stat_sender: Sender<String>
§blockchain_sync_state: BlockchainSyncState
Implementations§
Source§impl RoutingThread
impl RoutingThread
pub async fn set_my_key_list(&mut self, key_list: Vec<SaitoPublicKey>)
pub async fn process_incoming_blockchain_request( &self, request: BlockchainRequest, peer_index: u64, )
Trait Implementations§
Source§impl ProcessEvent<RoutingEvent> for RoutingThread
impl ProcessEvent<RoutingEvent> for RoutingThread
Source§fn process_network_event<'life0, 'async_trait>(
&'life0 mut self,
event: NetworkEvent,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process_network_event<'life0, 'async_trait>(
&'life0 mut self,
event: NetworkEvent,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Processes an event coming from other peers via network controller Read more
Source§fn process_timer_event<'life0, 'async_trait>(
&'life0 mut self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process_timer_event<'life0, 'async_trait>(
&'life0 mut self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Triggered with each timer tick. duration will vary due to other processing tasks in the same thread. Read more
Source§fn process_event<'life0, 'async_trait>(
&'life0 mut self,
event: RoutingEvent,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process_event<'life0, 'async_trait>(
&'life0 mut self,
event: RoutingEvent,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Processes the incoming events from other threads/controllers. Read more
fn on_init<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_stat_interval<'life0, 'async_trait>(
&'life0 mut self,
current_time: Timestamp,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_ready_to_process(&self) -> bool
Auto Trait Implementations§
impl Freeze for RoutingThread
impl !RefUnwindSafe for RoutingThread
impl Send for RoutingThread
impl Sync for RoutingThread
impl Unpin for RoutingThread
impl !UnwindSafe for RoutingThread
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more