From d3c2dbbc5ff8eb9e8d3df3d45675c9cada07dc26 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 21 Oct 2018 14:27:00 +0200 Subject: Do not publish new block when posting --- src/main.rs | 3 +++ src/repository/client.rs | 9 +-------- src/repository/mod.rs | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index c5776b9..8ad9b3b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -813,6 +813,9 @@ fn main() { .and_then(move |(key_id, ipfs_hash)| { repo.new_text_post(key_id, ipfs_hash, text, Some(time)) }) + .map(|hash| { + println!("{}", hash); + }) .map_err(|e| { error!("Error running: {:?}", e); print_error_details(e); diff --git a/src/repository/client.rs b/src/repository/client.rs index 103066c..284d052 100644 --- a/src/repository/client.rs +++ b/src/repository/client.rs @@ -255,7 +255,7 @@ pub fn new_text_post(client: Arc, latest_block: IPFSHash, text: String, time: Option) - -> impl Future + -> impl Future { let client1 = client.clone(); let client2 = client.clone(); @@ -290,13 +290,6 @@ pub fn new_text_post(client: Arc, let block = Block::new(protocol_version(), vec![latest_block], content_obj_hash); put_block(client4, &block) }) - .and_then(move |block_hash| { - ::repository::client::announce_block(client5, - publish_key_id, - &block_hash, - None, // IPFS default - None) // IPFS default - }) } diff --git a/src/repository/mod.rs b/src/repository/mod.rs index 84937ce..d829574 100644 --- a/src/repository/mod.rs +++ b/src/repository/mod.rs @@ -243,7 +243,7 @@ impl Repository { latest_block: IPFSHash, text: String, time: Option) - -> impl Future + -> impl Future { debug!("New text post under {:?}, after block {:?}", publish_key_id, latest_block); ::repository::client::new_text_post(self.client.clone(), -- cgit v1.2.3