Skip to content
Snippets Groups Projects

Write `get-file` and commands to get the list of blocks from another node

1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
@@ -126,7 +126,7 @@ where
file_dir: PathBuf,
pending_start_providing: HashMap<kad::QueryId, Sender<()>>,
pending_get_providers: HashMap<kad::QueryId, Sender<Vec<PeerId>>>,
pending_request_file: HashMap<OutboundRequestId, Sender<Vec<u8>>>,
pending_request_block: HashMap<OutboundRequestId, Sender<Vec<u8>>>,
}
impl<F, G> DragoonNetwork<F, G>
@@ -147,7 +147,7 @@ where
file_dir: Self::create_block_dir(peer_id, replace).unwrap(),
pending_start_providing: Default::default(),
pending_get_providers: Default::default(),
pending_request_file: Default::default(),
pending_request_block: Default::default(),
}
}
@@ -314,7 +314,7 @@ where
request_id,
response,
} => {
if let Some(sender) = self.pending_request_file.remove(&request_id) {
if let Some(sender) = self.pending_request_block.remove(&request_id) {
if sender.send(Ok(response.0)).is_err() {
error!("Couldn't send the result of the message response operation of id {}", request_id);
}
@@ -494,7 +494,7 @@ where
block_hash,
},
);
self.pending_request_file.insert(request_id, sender);
self.pending_request_block.insert(request_id, sender);
}
DragoonCommand::DragoonPeers { sender } => {
if sender
Loading