diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-10-21 14:27:00 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-10-21 14:54:29 +0200 |
commit | d3c2dbbc5ff8eb9e8d3df3d45675c9cada07dc26 (patch) | |
tree | f1d43f4a3e24e2db40bdd6d68cf2c30f51f83b69 | |
parent | 2b6e3fb20f8069a1853873467a4c864997343603 (diff) |
Do not publish new block when posting
-rw-r--r-- | src/main.rs | 3 | ||||
-rw-r--r-- | src/repository/client.rs | 9 | ||||
-rw-r--r-- | 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<IpfsClient>, latest_block: IPFSHash, text: String, time: Option<NaiveDateTime>) - -> impl Future<Item = (), Error = Error> + -> impl Future<Item = IPFSHash, Error = Error> { let client1 = client.clone(); let client2 = client.clone(); @@ -290,13 +290,6 @@ pub fn new_text_post(client: Arc<IpfsClient>, 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<NaiveDateTime>) - -> impl Future<Item = (), Error = Error> + -> impl Future<Item = IPFSHash, Error = Error> { debug!("New text post under {:?}, after block {:?}", publish_key_id, latest_block); ::repository::client::new_text_post(self.client.clone(), |