From d7c9032dd8af88b80114bee39a5446aa1894c0ac Mon Sep 17 00:00:00 2001 From: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com> Date: Sat, 8 Jun 2024 02:40:28 +0100 Subject: [PATCH] fix imports --- p2p/cuprate-p2p/src/block_downloader.rs | 31 ++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/p2p/cuprate-p2p/src/block_downloader.rs b/p2p/cuprate-p2p/src/block_downloader.rs index 7e3a2136..0ee1b8bd 100644 --- a/p2p/cuprate-p2p/src/block_downloader.rs +++ b/p2p/cuprate-p2p/src/block_downloader.rs @@ -1,26 +1,26 @@ //! # Block Downloader //! - -mod chain_tracker; - -use std::cmp::{max, min, Ordering, Reverse}; -use std::collections::{BTreeMap, BinaryHeap, HashSet}; -use std::sync::Arc; -use std::time::Duration; +use std::{ + cmp::{max, min, Ordering, Reverse}, + collections::{BTreeMap, BinaryHeap, HashSet}, + sync::Arc, + time::Duration, +}; use monero_serai::{block::Block, transaction::Transaction}; use rand::prelude::*; use rayon::prelude::*; -use tokio::task::JoinSet; -use tokio::time::{interval, MissedTickBehavior}; +use tokio::{ + task::JoinSet, + time::{interval, MissedTickBehavior}, +}; use tower::{Service, ServiceExt}; -use crate::block_downloader::chain_tracker::{BlocksToRetrieve, ChainEntry, ChainTracker}; use async_buffer::{BufferAppender, BufferStream}; use cuprate_helper::asynch::rayon_spawn_async; use fixed_bytes::ByteArrayVec; -use monero_p2p::client::InternalPeerID; use monero_p2p::{ + client::InternalPeerID, handles::ConnectionHandle, services::{PeerSyncRequest, PeerSyncResponse}, NetworkZone, PeerRequest, PeerResponse, PeerSyncSvc, @@ -28,8 +28,13 @@ use monero_p2p::{ use monero_pruning::CRYPTONOTE_MAX_BLOCK_HEIGHT; use monero_wire::protocol::{ChainRequest, ChainResponse, GetObjectsRequest}; -use crate::client_pool::{ClientPool, ClientPoolDropGuard}; -use crate::constants::{INITIAL_CHAIN_REQUESTS_TO_SEND, LONG_BAN, MEDIUM_BAN}; +use crate::{ + client_pool::{ClientPool, ClientPoolDropGuard}, + constants::{INITIAL_CHAIN_REQUESTS_TO_SEND, LONG_BAN, MEDIUM_BAN}, +}; + +mod chain_tracker; +use chain_tracker::{BlocksToRetrieve, ChainEntry, ChainTracker}; /// A downloaded batch of blocks. #[derive(Debug)]