This commit is contained in:
boqiu 2024-12-04 18:15:37 +08:00
parent 3bb242954b
commit 686e7a42e8
2 changed files with 15 additions and 16 deletions

View File

@ -15,12 +15,12 @@ pub const ANNOUNCE_FILE_TOPIC: &str = "announce_file";
pub const ANNOUNCE_CHUNKS_TOPIC: &str = "announce_chunks"; pub const ANNOUNCE_CHUNKS_TOPIC: &str = "announce_chunks";
pub const ANNOUNCE_SHARD_CONFIG_TOPIC: &str = "announce_shard_config"; pub const ANNOUNCE_SHARD_CONFIG_TOPIC: &str = "announce_shard_config";
pub const CORE_TOPICS: [GossipKind; 1] = [ pub const CORE_TOPICS: [GossipKind; 5] = [
GossipKind::NewFile, GossipKind::NewFile,
// GossipKind::FindFile, GossipKind::FindFile,
// GossipKind::FindChunks, GossipKind::FindChunks,
// GossipKind::AnnounceFile, GossipKind::AnnounceFile,
// GossipKind::AnnounceChunks, GossipKind::AnnounceChunks,
]; ];
/// A gossipsub topic which encapsulates the type of messages that should be sent and received over /// A gossipsub topic which encapsulates the type of messages that should be sent and received over

View File

@ -237,22 +237,21 @@ impl RouterService {
.. ..
} => { } => {
if matches!(message, PubsubMessage::AnnounceFile(..)) { if matches!(message, PubsubMessage::AnnounceFile(..)) {
let maybe_peer = self let source_version = self
.network_globals .network_globals
.peers .peers
.read() .read()
.peer_info(&source) .peer_info(&source)
.cloned(); .map(|i| i.client().version.clone());
if let Some(peer) = maybe_peer { let prop_source_version = self
let ip = peer.seen_ip_addresses().collect::<Vec<IpAddr>>(); .network_globals
let agent = peer.client().agent_string.clone(); .peers
let connection = peer.connection_status().clone(); .read()
let conn_dir = peer.connection_direction().cloned(); .peer_info(&propagation_source)
debug!(%source, ?ip, ?agent, ?connection, ?conn_dir, "Received AnnounceFile pubsub message"); .map(|i| i.client().version.clone());
} else {
debug!(%source, "Received AnnounceFile pubsub message, but not found in peer db"); debug!(%source, ?source_version, %propagation_source, ?prop_source_version, "Received AnnounceFile pubsub message");
}
} }
let result = self let result = self