Skip to content

Commit 275f1e2

Browse files
committed
chore: address more PR feedback
1 parent 26cedd7 commit 275f1e2

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,6 @@ impl BlockMinerThread {
239239
}
240240
}
241241

242-
pub fn get_abort_flag(&self) -> Arc<AtomicBool> {
243-
self.abort_flag.clone()
244-
}
245-
246242
#[cfg(test)]
247243
fn fault_injection_block_broadcast_stall(new_block: &NakamotoBlock) {
248244
if TEST_BROADCAST_STALL.get() {

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,6 @@ impl MinerStopHandle {
218218
self.join_handle
219219
}
220220

221-
/// Set the miner-abort flag to true, which causes the miner thread to exit if it is blocked.
222-
pub fn set_abort_flag(&self) {
223-
self.abort_flag.store(true, Ordering::SeqCst);
224-
}
225-
226-
/// Get an Arc to the abort flag, so another thread can set it.
227-
pub fn get_abort_flag(&self) -> Arc<AtomicBool> {
228-
self.abort_flag.clone()
229-
}
230-
231221
/// Stop the inner miner thread.
232222
/// Blocks the miner, and sets the abort flag so that a blocked miner will error out.
233223
pub fn stop(self, globals: &Globals) -> Result<(), NakamotoNodeError> {
@@ -238,7 +228,7 @@ impl MinerStopHandle {
238228
&my_id, &prior_thread_id
239229
);
240230

241-
self.set_abort_flag();
231+
self.abort_flag.store(true, Ordering::SeqCst);
242232
globals.block_miner();
243233

244234
let prior_miner = self.into_inner();
@@ -1109,7 +1099,7 @@ impl RelayerThread {
11091099
reason,
11101100
burn_tip_at_start,
11111101
)?;
1112-
let miner_abort_flag = new_miner_state.get_abort_flag();
1102+
let miner_abort_flag = new_miner_state.abort_flag.clone();
11131103

11141104
debug!("Relayer: starting new tenure thread");
11151105

@@ -1155,7 +1145,7 @@ impl RelayerThread {
11551145
self.miner_thread_burn_view = None;
11561146

11571147
let id = prior_tenure_thread.inner_thread().id();
1158-
let abort_flag = prior_tenure_thread.get_abort_flag();
1148+
let abort_flag = prior_tenure_thread.abort_flag.clone();
11591149
let globals = self.globals.clone();
11601150

11611151
let stop_handle = std::thread::Builder::new()

0 commit comments

Comments
 (0)