diff --git a/binaries/cuprated/src/blockchain/interface.rs b/binaries/cuprated/src/blockchain/interface.rs index 84c81e06..bdf1bf33 100644 --- a/binaries/cuprated/src/blockchain/interface.rs +++ b/binaries/cuprated/src/blockchain/interface.rs @@ -1,16 +1,16 @@ -//! The blockchain manger interface. +//! The blockchain manager interface. //! //! This module contains all the functions to mutate the blockchain's state in any way, through the -//! blockchain manger. -use monero_serai::{block::Block, transaction::Transaction}; -use rayon::prelude::*; -use std::sync::LazyLock; +//! blockchain manager. use std::{ collections::{HashMap, HashSet}, - sync::{Mutex, OnceLock}, + sync::{Mutex, OnceLock, LazyLock}, }; + use tokio::sync::{mpsc, oneshot}; use tower::{Service, ServiceExt}; +use monero_serai::{block::Block, transaction::Transaction}; +use rayon::prelude::*; use cuprate_blockchain::service::BlockchainReadHandle; use cuprate_consensus::transactions::new_tx_verification_data; @@ -24,9 +24,9 @@ use crate::{ blockchain::manager::BlockchainManagerCommand, constants::PANIC_CRITICAL_SERVICE_ERROR, }; -/// The channel used to send [`BlockchainManagerCommand`]s to the blockchain manger. +/// The channel used to send [`BlockchainManagerCommand`]s to the blockchain manager. /// -/// This channel is initialized in [`init_blockchain_manger`](super::manager::init_blockchain_manger). +/// This channel is initialized in [`init_blockchain_manager`](super::manager::init_blockchain_manager). pub(super) static COMMAND_TX: OnceLock> = OnceLock::new(); /// An error that can be returned from [`handle_incoming_block`]. @@ -50,7 +50,7 @@ pub enum IncomingBlockError { /// This returns a [`bool`] indicating if the block was added to the main-chain ([`true`]) or an alt-chain /// ([`false`]). /// -/// If we already knew about this block or the blockchain manger is not setup yet `Ok(false)` is returned. +/// If we already knew about this block or the blockchain manager is not setup yet `Ok(false)` is returned. /// /// # Errors /// @@ -110,7 +110,7 @@ pub async fn handle_incoming_block( .map_err(IncomingBlockError::InvalidBlock)?; let Some(incoming_block_tx) = COMMAND_TX.get() else { - // We could still be starting up the blockchain manger, so just return this as there is nothing + // We could still be starting up the blockchain manager, so just return this as there is nothing // else we can do. return Ok(false); }; diff --git a/binaries/cuprated/src/blockchain/manager.rs b/binaries/cuprated/src/blockchain/manager.rs index 8725aeca..eae92520 100644 --- a/binaries/cuprated/src/blockchain/manager.rs +++ b/binaries/cuprated/src/blockchain/manager.rs @@ -37,11 +37,11 @@ mod handler; pub use commands::BlockchainManagerCommand; -/// Initialize the blockchain manger. +/// Initialize the blockchain manager. /// /// This function sets up the [`BlockchainManager`] and the [`syncer`] so that the functions in [`interface`](super::interface) /// can be called. -pub async fn init_blockchain_manger( +pub async fn init_blockchain_manager( clearnet_interface: NetworkInterface, blockchain_write_handle: BlockchainWriteHandle, blockchain_read_handle: BlockchainReadHandle, @@ -76,7 +76,7 @@ pub async fn init_blockchain_manger( panic!("Blockchain context service returned wrong response!"); }; - let manger = BlockchainManager { + let manager = BlockchainManager { blockchain_write_handle, blockchain_read_handle, blockchain_context_service, @@ -86,7 +86,7 @@ pub async fn init_blockchain_manger( broadcast_svc: clearnet_interface.broadcast_svc(), }; - tokio::spawn(manger.run(batch_rx, command_rx)); + tokio::spawn(manager.run(batch_rx, command_rx)); } /// The blockchain manager. diff --git a/binaries/cuprated/src/blockchain/manager/handler.rs b/binaries/cuprated/src/blockchain/manager/handler.rs index 14073062..23e8295b 100644 --- a/binaries/cuprated/src/blockchain/manager/handler.rs +++ b/binaries/cuprated/src/blockchain/manager/handler.rs @@ -1,4 +1,4 @@ -//! The blockchain manger handler functions. +//! The blockchain manager handler functions. use std::{collections::HashMap, sync::Arc}; use bytes::Bytes;