File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
testnet/stacks-node/src/run_loop Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,11 @@ impl RunLoop {
166
166
/// If there's a network error, then assume that we're not a miner.
167
167
fn check_is_miner ( & mut self , burnchain : & mut BitcoinRegtestController ) -> bool {
168
168
if self . config . node . miner {
169
+ // If we are mock mining, then we don't need to check for UTXOs and
170
+ // we can just return true.
171
+ if self . config . get_node_config ( false ) . mock_mining {
172
+ return true ;
173
+ }
169
174
let keychain = Keychain :: default ( self . config . node . seed . clone ( ) ) ;
170
175
let mut op_signer = keychain. generate_op_signer ( ) ;
171
176
if let Err ( e) = burnchain. create_wallet_if_dne ( ) {
@@ -206,10 +211,6 @@ impl RunLoop {
206
211
return true ;
207
212
}
208
213
}
209
- if self . config . get_node_config ( false ) . mock_mining {
210
- info ! ( "No UTXOs found, but configured to mock mine" ) ;
211
- return true ;
212
- }
213
214
thread:: sleep ( std:: time:: Duration :: from_secs ( Self :: UTXO_RETRY_INTERVAL ) ) ;
214
215
}
215
216
panic ! ( "No UTXOs found, exiting" ) ;
Original file line number Diff line number Diff line change @@ -414,6 +414,11 @@ impl RunLoop {
414
414
/// If there's a network error, then assume that we're not a miner.
415
415
fn check_is_miner ( & mut self , burnchain : & mut BitcoinRegtestController ) -> bool {
416
416
if self . config . node . miner {
417
+ // If we are mock mining, then we don't need to check for UTXOs and
418
+ // we can just return true.
419
+ if self . config . get_node_config ( false ) . mock_mining {
420
+ return true ;
421
+ }
417
422
let keychain = Keychain :: default ( self . config . node . seed . clone ( ) ) ;
418
423
let mut op_signer = keychain. generate_op_signer ( ) ;
419
424
if let Err ( e) = burnchain. create_wallet_if_dne ( ) {
@@ -454,10 +459,6 @@ impl RunLoop {
454
459
return true ;
455
460
}
456
461
}
457
- if self . config . get_node_config ( false ) . mock_mining {
458
- info ! ( "No UTXOs found, but configured to mock mine" ) ;
459
- return true ;
460
- }
461
462
thread:: sleep ( std:: time:: Duration :: from_secs ( Self :: UTXO_RETRY_INTERVAL ) ) ;
462
463
}
463
464
panic ! ( "No UTXOs found, exiting" ) ;
You can’t perform that action at this time.
0 commit comments