Skip to content

Commit 68ea4da

Browse files
committed
Increment block resposnes sent all the time
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 09d920c commit 68ea4da

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

stacks-signer/src/v0/signer.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,17 @@ impl Signer {
339339
};
340340
// Submit a proposal response to the .signers contract for miners
341341
debug!("{self}: Broadcasting a block response to stacks node: {block_response:?}");
342-
if let Err(e) = self
342+
let accepted = matches!(block_response, BlockResponse::Accepted(..));
343+
match self
343344
.stackerdb
344345
.send_message_with_retry::<SignerMessage>(block_response.into())
345346
{
346-
warn!("{self}: Failed to send block rejection to stacker-db: {e:?}",);
347+
Ok(_) => {
348+
crate::monitoring::increment_block_responses_sent(accepted);
349+
}
350+
Err(e) => {
351+
warn!("{self}: Failed to send block rejection to stacker-db: {e:?}",);
352+
}
347353
}
348354
return;
349355
}
@@ -612,12 +618,12 @@ impl Signer {
612618
info!(
613619
"{self}: Broadcasting a block response to stacks node: {response:?}";
614620
);
621+
let accepted = matches!(response, BlockResponse::Accepted(..));
615622
match self
616623
.stackerdb
617-
.send_message_with_retry::<SignerMessage>(response.clone().into())
624+
.send_message_with_retry::<SignerMessage>(response.into())
618625
{
619626
Ok(_) => {
620-
let accepted = matches!(response, BlockResponse::Accepted(..));
621627
crate::monitoring::increment_block_responses_sent(accepted);
622628
}
623629
Err(e) => {

0 commit comments

Comments
 (0)