Skip to content

Commit 4b7b52c

Browse files
committed
refactor: remove �llow_rbf field from BitcoinRegtestController
1 parent 78da794 commit 4b7b52c

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ pub struct BitcoinRegtestController {
101101
burnchain_config: Option<Burnchain>,
102102
ongoing_block_commit: Option<OngoingBlockCommit>,
103103
should_keep_running: Option<Arc<AtomicBool>>,
104-
allow_rbf: bool,
105104
}
106105

107106
#[derive(Clone)]
@@ -357,7 +356,6 @@ impl BitcoinRegtestController {
357356
burnchain_config: burnchain,
358357
ongoing_block_commit: None,
359358
should_keep_running,
360-
allow_rbf: true,
361359
}
362360
}
363361

@@ -403,7 +401,6 @@ impl BitcoinRegtestController {
403401
burnchain_config: None,
404402
ongoing_block_commit: None,
405403
should_keep_running: None,
406-
allow_rbf: true,
407404
}
408405
}
409406

@@ -748,19 +745,14 @@ impl BitcoinRegtestController {
748745

749746
// Configure UTXO filter
750747
let address = self.get_miner_address(epoch_id, &pubk);
751-
test_debug!(
752-
"Get UTXOs for {} ({}) rbf={}",
753-
pubk.to_hex(),
754-
addr2str(&address),
755-
self.allow_rbf
756-
);
748+
test_debug!("Get UTXOs for {} ({})", pubk.to_hex(), addr2str(&address),);
757749
let filter_addresses = vec![addr2str(&address)];
758750

759751
let mut utxos = loop {
760752
let result = BitcoinRPCRequest::list_unspent(
761753
&self.config,
762754
filter_addresses.clone(),
763-
!self.allow_rbf, // if RBF is disabled, then we can use 0-conf txs
755+
false,
764756
total_required,
765757
&utxos_to_exclude,
766758
block_height,
@@ -794,7 +786,7 @@ impl BitcoinRegtestController {
794786
let result = BitcoinRPCRequest::list_unspent(
795787
&self.config,
796788
filter_addresses.clone(),
797-
!self.allow_rbf, // if RBF is disabled, then we can use 0-conf txs
789+
false,
798790
total_required,
799791
&utxos_to_exclude,
800792
block_height,
@@ -1510,7 +1502,7 @@ impl BitcoinRegtestController {
15101502
signer: &mut BurnchainOpSigner,
15111503
) -> Result<Transaction, BurnchainControllerError> {
15121504
// Are we currently tracking an operation?
1513-
if self.ongoing_block_commit.is_none() || !self.allow_rbf {
1505+
if self.ongoing_block_commit.is_none() {
15141506
// Good to go, let's build the transaction and send it.
15151507
let res =
15161508
self.send_block_commit_operation(epoch_id, payload, signer, None, None, None, &[]);

0 commit comments

Comments
 (0)