mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-22 02:34:31 +00:00
fix previous merge
This commit is contained in:
parent
c5a493a186
commit
cefd8a7a3f
2 changed files with 13 additions and 8 deletions
|
@ -626,7 +626,7 @@ where
|
|||
// block downloader.
|
||||
self.inflight_requests.get(&start_height).inspect(|entry| {
|
||||
tracing::warn!(
|
||||
"Received an invalid chain from peer: {}, exiting block downloader (it will be restarted).",
|
||||
"Received an invalid chain from peer: {}, exiting block downloader (it should be restarted).",
|
||||
entry.peer_who_told_us
|
||||
);
|
||||
entry.peer_who_told_us_handle.ban_peer(LONG_BAN)
|
||||
|
@ -867,6 +867,11 @@ async fn request_batch_from_peer<N: NetworkZone>(
|
|||
.number()
|
||||
.is_some_and(|height| height == expected_height)
|
||||
{
|
||||
tracing::warn!(
|
||||
"Invalid chain, expected height: {expected_height}, got height: {:?}",
|
||||
block.number()
|
||||
);
|
||||
|
||||
// This peer probably did nothing wrong, it was the peer who told us this blockID which
|
||||
// is misbehaving.
|
||||
return Err(BlockDownloadError::ChainInvalid);
|
||||
|
|
|
@ -30,9 +30,7 @@ mod constants;
|
|||
mod inbound_server;
|
||||
mod sync_states;
|
||||
|
||||
use crate::block_downloader::{
|
||||
BlockBatch, BlockDownloaderConfig, ChainSvcRequest, ChainSvcResponse,
|
||||
};
|
||||
use block_downloader::{BlockBatch, BlockDownloaderConfig, ChainSvcRequest, ChainSvcResponse};
|
||||
pub use broadcast::{BroadcastRequest, BroadcastSvc};
|
||||
use client_pool::ClientPoolDropGuard;
|
||||
pub use config::P2PConfig;
|
||||
|
@ -41,11 +39,13 @@ use monero_p2p::services::PeerSyncRequest;
|
|||
|
||||
/// Initializes the P2P [`NetworkInterface`] for a specific [`NetworkZone`].
|
||||
///
|
||||
/// This function starts all the tasks to maintain connections/ accept connections/ make connections.
|
||||
/// This function starts all the tasks to maintain/accept/make connections.
|
||||
///
|
||||
/// To use you must provide, a peer request handler, which is given to each connection and a core sync service
|
||||
/// which keeps track of the sync state of our node.
|
||||
#[instrument(level="debug", name="net", skip_all, fields(zone=N::NAME))]
|
||||
/// # Usage
|
||||
/// You must provide:
|
||||
/// - A peer request handler, which is given to each connection
|
||||
/// - A core sync service, which keeps track of the sync state of our node
|
||||
#[instrument(level = "debug", name = "net", skip_all, fields(zone = N::NAME))]
|
||||
pub async fn initialize_network<N, R, CS>(
|
||||
peer_req_handler: R,
|
||||
core_sync_svc: CS,
|
||||
|
|
Loading…
Reference in a new issue