From 68ea4da1c105a894406891caf7adc62f05652fdd Mon Sep 17 00:00:00 2001 From: Jacinta Ferrant Date: Fri, 25 Oct 2024 12:43:45 -0700 Subject: [PATCH] Increment block resposnes sent all the time Signed-off-by: Jacinta Ferrant --- stacks-signer/src/v0/signer.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/stacks-signer/src/v0/signer.rs b/stacks-signer/src/v0/signer.rs index 2cb10a9817..2d6bfa003d 100644 --- a/stacks-signer/src/v0/signer.rs +++ b/stacks-signer/src/v0/signer.rs @@ -339,11 +339,17 @@ impl Signer { }; // Submit a proposal response to the .signers contract for miners debug!("{self}: Broadcasting a block response to stacks node: {block_response:?}"); - if let Err(e) = self + let accepted = matches!(block_response, BlockResponse::Accepted(..)); + match self .stackerdb .send_message_with_retry::(block_response.into()) { - warn!("{self}: Failed to send block rejection to stacker-db: {e:?}",); + Ok(_) => { + crate::monitoring::increment_block_responses_sent(accepted); + } + Err(e) => { + warn!("{self}: Failed to send block rejection to stacker-db: {e:?}",); + } } return; } @@ -612,12 +618,12 @@ impl Signer { info!( "{self}: Broadcasting a block response to stacks node: {response:?}"; ); + let accepted = matches!(response, BlockResponse::Accepted(..)); match self .stackerdb - .send_message_with_retry::(response.clone().into()) + .send_message_with_retry::(response.into()) { Ok(_) => { - let accepted = matches!(response, BlockResponse::Accepted(..)); crate::monitoring::increment_block_responses_sent(accepted); } Err(e) => {