chore: clean up previous merge

This commit is contained in:
Jude Nelson
2022-03-22 15:08:14 -04:00
parent 1749aa900c
commit 7c7a075fa4
7 changed files with 8 additions and 11 deletions

View File

@@ -636,9 +636,8 @@ impl Burnchain {
}
/// Connect to the burnchain databases. They may or may not already exist.
pub fn connect_db<I: BurnchainIndexer>(
pub fn connect_db(
&self,
indexer: &I,
readwrite: bool,
first_block_header_hash: BurnchainHeaderHash,
first_block_header_timestamp: u64,
@@ -959,7 +958,6 @@ impl Burnchain {
) -> Result<(BlockSnapshot, Option<BurnchainStateTransition>), burnchain_error> {
self.setup_chainstate(indexer)?;
let (mut sortdb, mut burnchain_db) = self.connect_db(
indexer,
true,
indexer.get_first_block_header_hash()?,
indexer.get_first_block_header_timestamp()?,
@@ -1213,7 +1211,6 @@ impl Burnchain {
{
self.setup_chainstate(indexer)?;
let (_, mut burnchain_db) = self.connect_db(
indexer,
true,
indexer.get_first_block_header_hash()?,
indexer.get_first_block_header_timestamp()?,

View File

@@ -35,7 +35,7 @@ use crate::types::chainstate::BlockHeaderHash;
use crate::types::chainstate::SortitionId;
use crate::types::chainstate::StacksBlockId;
use crate::types::chainstate::StacksMicroblockHeader;
use crate::types::TrieHash;
use crate::types::proof::TrieHash;
use crate::util::boot::{boot_code_acc, boot_code_addr, boot_code_id, boot_code_tx_auth};
use crate::util::secp256k1::MessageSignature;
use crate::{
@@ -77,7 +77,7 @@ use vm::types::{
TypeSignature, Value,
};
use util_lib::db::Error as db_error;
use util::db::Error as db_error;
///
/// A high-level interface for interacting with the Clarity VM.

View File

@@ -826,7 +826,6 @@ simulating a miner.
);
let (mut new_sortition_db, _) = burnchain
.connect_db(
&indexer,
true,
first_burnchain_block_hash,
BITCOIN_REGTEST_FIRST_BLOCK_TIMESTAMP.into(),

View File

@@ -280,7 +280,7 @@ impl BurnStateDB for NullBurnStateDB {
network_epoch: PEER_VERSION_EPOCH_2_0,
})
}
fn get_stacks_epoch_by_epoch_id(&self, epoch_id: &StacksEpochId) -> Option<StacksEpoch> {
fn get_stacks_epoch_by_epoch_id(&self, _epoch_id: &StacksEpochId) -> Option<StacksEpoch> {
self.get_stacks_epoch(0)
}

View File

@@ -399,7 +399,7 @@ impl SequenceData {
}
pub fn slice(self, left_position: usize, right_position: usize) -> Result<Value> {
let empty_seq = (left_position == right_position);
let empty_seq = left_position == right_position;
let result = match self {
SequenceData::Buffer(data) => {

View File

@@ -1493,7 +1493,6 @@ impl BurnchainController for BitcoinRegtestController {
fn connect_dbs(&mut self) -> Result<(), BurnchainControllerError> {
let burnchain = self.get_burnchain();
burnchain.connect_db(
&self.indexer,
true,
self.indexer.get_first_block_header_hash()?,
self.indexer.get_first_block_header_timestamp()?,

View File

@@ -9,7 +9,7 @@ use std::sync::{atomic::Ordering, Arc, Mutex};
use std::{thread, thread::JoinHandle};
use stacks::burnchains::{Burnchain, BurnchainParameters, Txid};
use stacks::burnchains::{BurnchainSigner, PoxConstants};
use stacks::burnchains::BurnchainSigner;
use stacks::chainstate::burn::db::sortdb::SortitionDB;
use stacks::chainstate::burn::operations::{
leader_block_commit::{RewardSetInfo, BURN_BLOCK_MINED_AT_MODULUS},
@@ -630,6 +630,8 @@ fn spawn_peer(
let mut sync_comms = runloop.get_pox_sync_comms();
let event_dispatcher = runloop.get_event_dispatcher();
let should_keep_running = runloop.get_termination_switch();
let burnchain = runloop.get_burnchain();
let pox_constants = burnchain.pox_constants;
let is_mainnet = config.is_mainnet();
let burn_db_path = config.get_burn_db_file_path();