Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Boog900 committed Jun 6, 2024
1 parent 9edcb76 commit d3e784d
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 28 deletions.
62 changes: 61 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 19 additions & 25 deletions p2p/cuprate-p2p/src/bin/test_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,30 +153,24 @@ async fn main() {

sleep(Duration::from_secs(15)).await;

loop {
let mut buffer = download_blocks(
net.pool.clone(),
net.sync_states_svc.clone(),
OurChainSvc,
BlockDownloaderConfig {
buffer_size: 50_000_000,
in_progress_queue_size: 30_000_000,
check_client_pool_interval: Duration::from_secs(10),
target_batch_size: 5_000_000,
initial_batch_size: 10,
},
);

while let Some(entry) = buffer.next().await {
tracing::info!(
"height: {}, amount{}",
entry.blocks[0].0.number().unwrap(),
entry.blocks.len()
)
}

panic!();

sleep(Duration::from_secs(2)).await;
let mut buffer = download_blocks(
net.pool.clone(),
net.sync_states_svc.clone(),
OurChainSvc,
BlockDownloaderConfig {
buffer_size: 50_000_000,
in_progress_queue_size: 30_000_000,
check_client_pool_interval: Duration::from_secs(10),
target_batch_size: 5_000_000,
initial_batch_size: 10,
},
);

while let Some(entry) = buffer.next().await {
tracing::info!(
"height: {}, amount{}",
entry.blocks[0].0.number().unwrap(),
entry.blocks.len()
)
}
}
3 changes: 1 addition & 2 deletions p2p/cuprate-p2p/src/block_downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

mod chain_tracker;

use futures::FutureExt;
use std::cmp::{max, min, Ordering, Reverse};
use std::collections::{BTreeMap, BinaryHeap, HashSet, VecDeque};
use std::collections::{BTreeMap, BinaryHeap, HashSet};
use std::sync::Arc;
use std::time::Duration;

Expand Down
1 change: 1 addition & 0 deletions p2p/cuprate-p2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use monero_p2p::{
CoreSyncSvc, NetworkZone, PeerRequestHandler,
};

pub mod block_downloader;
mod broadcast;
mod client_pool;
pub mod config;
Expand Down

0 comments on commit d3e784d

Please sign in to comment.