mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
repo: updated everything to merged stuff
This commit is contained in:
@@ -142,10 +142,7 @@ impl Dht {
|
||||
Some(_) => {
|
||||
debug!(target: "dht", "Key removed: {}", key);
|
||||
let request = LookupRequest::new(self.id, key, 1);
|
||||
if let Err(e) = self.p2p.broadcast(&request).await {
|
||||
error!(target: "dht", "Failed broadcasting request: {}", e);
|
||||
return Err(e)
|
||||
}
|
||||
self.p2p.broadcast(&request).await;
|
||||
|
||||
self.lookup_remove(key, self.id)
|
||||
}
|
||||
@@ -225,10 +222,7 @@ impl Dht {
|
||||
let peer = *peers.iter().last().unwrap();
|
||||
let request = KeyRequest::new(self.id, peer, key);
|
||||
// TODO: ask connected peers directly, not broadcast
|
||||
if let Err(e) = self.p2p.broadcast(request).await {
|
||||
error!(target: "dht", "Failed broadcasting request: {}", e);
|
||||
return Err(e)
|
||||
}
|
||||
self.p2p.broadcast(&request).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ impl Protocol {
|
||||
p2p: P2pPtr,
|
||||
) -> Result<ProtocolBasePtr> {
|
||||
debug!(target: "dht::protocol", "Adding Protocol to the protocol registry");
|
||||
let msg_subsystem = channel.get_message_subsystem();
|
||||
let msg_subsystem = channel.message_subsystem();
|
||||
msg_subsystem.add_dispatch::<KeyRequest>().await;
|
||||
msg_subsystem.add_dispatch::<KeyResponse>().await;
|
||||
msg_subsystem.add_dispatch::<LookupRequest>().await;
|
||||
|
||||
@@ -30,6 +30,9 @@ pub mod consensus;
|
||||
#[cfg(feature = "blockchain")]
|
||||
pub mod validator;
|
||||
|
||||
#[cfg(feature = "dht")]
|
||||
pub mod dht;
|
||||
|
||||
#[cfg(feature = "dht")]
|
||||
pub mod dht2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user