Skip to content

Commit 892e451

Browse files
committed
fix: move mock_mining check to get_utxos() caller while preserving behaviour (returning error), #5841
1 parent dffe26d commit 892e451

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -744,11 +744,6 @@ impl BitcoinRegtestController {
744744
utxos_to_exclude: Option<UTXOSet>,
745745
block_height: u64,
746746
) -> Option<UTXOSet> {
747-
// if mock mining, do not even bother requesting UTXOs
748-
if self.config.get_node_config(false).mock_mining {
749-
return None;
750-
}
751-
752747
let pubk = if self.config.miner.segwit && epoch_id >= StacksEpochId::Epoch21 {
753748
let mut p = *public_key;
754749
p.set_compressed(true);
@@ -1693,6 +1688,11 @@ impl BitcoinRegtestController {
16931688
// in RBF, you have to consume the same UTXOs
16941689
utxos
16951690
} else {
1691+
// if mock mining, do not even bother requesting UTXOs
1692+
if self.config.node.mock_mining {
1693+
return Err(BurnchainControllerError::NoUTXOs);
1694+
}
1695+
16961696
// Fetch some UTXOs
16971697
let addr = self.get_miner_address(epoch_id, public_key);
16981698
match self.get_utxos(

0 commit comments

Comments
 (0)