From 9443e0281d8f09ff3d5ac7d03bdba539e2b66719 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Mon, 29 Jan 2024 19:14:39 -0500 Subject: [PATCH] Removed duplication of `FIRE BLOCK` just to silence the payload --- src/polling.rs | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/polling.rs b/src/polling.rs index a8c9785..9b64bd4 100644 --- a/src/polling.rs +++ b/src/polling.rs @@ -171,29 +171,22 @@ impl Polling { }; let encoded: Block = b.try_into()?; - - if self.quiet { - println!( - "FIRE BLOCK {} {} {} {} {} {}", - block_num, - hex::encode(block_hash), - parent_num, - hex::encode(parent_hash), - lib, - timestamp - ); + let block_payload = if self.quiet { + "".to_string() } else { - println!( - "FIRE BLOCK {} {} {} {} {} {} {}", - block_num, - hex::encode(block_hash), - parent_num, - hex::encode(parent_hash), - lib, - timestamp, - general_purpose::STANDARD.encode(encoded.encode_to_vec()) - ); - } + general_purpose::STANDARD.encode(encoded.encode_to_vec()) + }; + + println!( + "FIRE BLOCK {} {} {} {} {} {} {}", + block_num, + hex::encode(block_hash), + parent_num, + hex::encode(parent_hash), + lib, + timestamp, + block_payload + ); Ok(()) }