Skip to content

Commit

Permalink
fix(chain-ops): Reset consecutive_errors counter to zero after a su…
Browse files Browse the repository at this point in the history
…ccessful broadcast.
  • Loading branch information
KirilMihaylov committed Sep 26, 2024
1 parent 1bb752a commit d2ddd7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chain-ops/src/task/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ where

Self::log_tx_response(source.as_ref(), tx_code, &response);

if tx_code.is_err() {
if tx_code.is_ok() {
self.consecutive_errors = 0;
} else {
self.consecutive_errors = (self.consecutive_errors + 1) % 5;

if self.consecutive_errors == 0 {
Expand Down

0 comments on commit d2ddd7b

Please sign in to comment.