use crate::records::memory::response_channels::Command; use crate::sled::Db; use crate::Arc; use crate::Mutex; use crate::TcpStream; // parameters used while searching backward for a shared // ancestor and deciding whether to replace the local tip pub struct OrphanCheckup { pub start_check: u32, pub stop_check: u32, pub original_start_check: u32, pub local_height: u32, pub remote_height: u32, pub recheck_from_height: Option, pub stream: Arc>, pub db: Db, pub map: Arc>, pub node_syncing: bool, pub connections_key: String, } // top-level orphan check context used by sync and broadcast // flows before the deeper rollback logic is chosen pub struct OrphanCheckup2 { pub stream: Arc>, pub db: Db, pub local_height: u32, pub remote_height: u32, pub recheck_from_height: Option, pub map: Arc>, pub node_syncing: bool, pub connections_key: String, } // shared rollback context used by undo/save paths once a // reorganization decision has already been made pub struct UndoTransactions { pub start_height: u32, pub replay_to_height: u32, pub db: Db, pub stream: Arc>, pub map: Arc>, pub node_syncing: bool, pub connections_key: String, } #[derive(Clone)] // lightweight cloneable context passed into the rule checks // before it is expanded into rollback-specific parameters pub struct CheckUp { pub local_height: u32, pub remote_height: u32, pub recheck_from_height: Option, pub db: Db, pub stream: Arc>, pub map: Arc>, pub node_syncing: bool, pub connections_key: String, }