Skip to content
Snippets Groups Projects

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

2 files
+ 5
3
Compare changes
  • Side-by-side
  • Inline

Files

+ 3
1
use anyhow::{self, Result};
use anyhow::{self, format_err, Result};
use futures::prelude::*;
use futures::stream::BoxStream;
@@ -126,6 +125,7 @@ pub(crate) struct DragoonBehaviour {
pub(crate) struct DragoonNetwork {
swarm: Swarm<DragoonBehaviour>,
command_receiver: mpsc::UnboundedReceiver<DragoonCommand>,
command_sender: mpsc::UnboundedSender<DragoonCommand>,
listeners: HashMap<u64, ListenerId>,
file_dir: PathBuf,
pending_start_providing: HashMap<kad::QueryId, Sender<()>>,
@@ -138,12 +138,14 @@ impl DragoonNetwork {
pub fn new(
swarm: Swarm<DragoonBehaviour>,
command_receiver: mpsc::UnboundedReceiver<DragoonCommand>,
command_sender: mpsc::UnboundedSender<DragoonCommand>,
peer_id: PeerId,
replace: bool,
) -> Self {
Self {
swarm,
command_receiver,
command_sender,
listeners: HashMap::new(),
file_dir: Self::create_block_dir(peer_id, replace).unwrap(),
pending_start_providing: Default::default(),
Loading