Moved default wallet creation to so it is constrained to test code

This commit is contained in:
Pavitthra Pandurangan
2021-04-14 12:28:06 -04:00
parent f331bad3af
commit 0fde36f125
2 changed files with 5 additions and 15 deletions

View File

@@ -1546,6 +1546,11 @@ impl BurnchainController for BitcoinRegtestController {
panic!();
}
}
info!("Creating wallet if it does not exist");
match self.create_wallet_if_dne() {
Err(e) => warn!("Error when creating wallet: {:?}", e),
_ => {}
}
}
}
}

View File

@@ -90,18 +90,6 @@ impl RunLoop {
#[cfg(not(test))]
fn bump_blocks_processed(&self) {}
#[cfg(test)]
fn create_wallet_if_dne(&self, burnchain: &BitcoinRegtestController) {
info!("Miner node: creating the wallet if it does not exist");
match burnchain.create_wallet_if_dne() {
Err(e) => warn!("Error when creating wallet: {:?}", e),
_ => {}
}
}
#[cfg(not(test))]
fn create_wallet_if_dne(&self, burnchain: &BitcoinRegtestController) {}
/// Starts the testnet runloop.
///
/// This function will block by looping infinitely.
@@ -135,9 +123,6 @@ impl RunLoop {
let pox_constants = burnchain.get_pox_constants();
let is_miner = if self.config.node.miner {
// Initialize the wallet.
self.create_wallet_if_dne(&burnchain);
let keychain = Keychain::default(self.config.node.seed.clone());
let node_address = Keychain::address_from_burnchain_signer(
&keychain.get_burnchain_signer(),