Skip to content

Commit 6a238a7

Browse files
committed
added set_miner_current_rejections_timeout and set_miner_current_rejections to Counters struct
1 parent fe429f4 commit 6a238a7

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

testnet/stacks-node/src/nakamoto_node/signer_coordinator.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,8 @@ impl SignerCoordinator {
406406
"rejections_step" => rejections_step,
407407
"rejections_threshold" => self.total_weight.saturating_sub(self.weight_threshold));
408408

409-
Counters::set(
410-
&counters.naka_miner_current_rejections_timeout_secs,
411-
rejections_timeout.as_secs(),
412-
);
413-
Counters::set(&counters.naka_miner_current_rejections, rejections);
409+
counters.set_miner_current_rejections_timeout(rejections_timeout.as_secs());
410+
counters.set_miner_current_rejections(rejections);
414411
}
415412

416413
if block_status

testnet/stacks-node/src/run_loop/neon.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ impl Counters {
139139
fn inc(_ctr: &RunLoopCounter) {}
140140

141141
#[cfg(test)]
142-
pub fn set(ctr: &RunLoopCounter, value: u64) {
142+
fn set(ctr: &RunLoopCounter, value: u64) {
143143
ctr.0.store(value, Ordering::SeqCst);
144144
}
145145

146146
#[cfg(not(test))]
147-
pub fn set(_ctr: &RunLoopCounter, _value: u64) {}
147+
fn set(_ctr: &RunLoopCounter, _value: u64) {}
148148

149149
pub fn bump_blocks_processed(&self) {
150150
Counters::inc(&self.blocks_processed);
@@ -217,6 +217,14 @@ impl Counters {
217217
pub fn set_microblocks_processed(&self, value: u64) {
218218
Counters::set(&self.microblocks_processed, value)
219219
}
220+
221+
pub fn set_miner_current_rejections_timeout(&self, value: u64) {
222+
Counters::set(&self.naka_miner_current_rejections_timeout_secs, value)
223+
}
224+
225+
pub fn set_miner_current_rejections(&self, value: u64) {
226+
Counters::set(&self.naka_miner_current_rejections, value)
227+
}
220228
}
221229

222230
/// Coordinating a node running in neon mode.

0 commit comments

Comments
 (0)