Skip to content

Commit

Permalink
Merge pull request #3626 from stacks-network/pointblankdev-maint/burn…
Browse files Browse the repository at this point in the history
…chain-naming-cleanup

Merge: PR #3598 burnchain naming to `develop`
  • Loading branch information
kantai authored Mar 22, 2023
2 parents cc58269 + 3c6d177 commit 8cb8340
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/burnchains/burnchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ impl Burnchain {
indexer.get_first_block_header_timestamp()?,
indexer.get_stacks_epochs(),
)?;
let burn_chain_tip = burnchain_db.get_canonical_chain_tip().map_err(|e| {
let burnchain_tip = burnchain_db.get_canonical_chain_tip().map_err(|e| {
error!("Failed to query burn chain tip from burn DB: {}", e);
e
})?;
Expand All @@ -1138,12 +1138,12 @@ impl Burnchain {

// does the bunchain db have more blocks than the sortition db has processed?
assert_eq!(last_snapshot_processed.block_height,
burn_chain_tip.block_height,
burnchain_tip.block_height,
"FATAL: Last snapshot processed height={} and current burnchain db height={} have diverged",
last_snapshot_processed.block_height,
burn_chain_tip.block_height);
burnchain_tip.block_height);

let db_height = burn_chain_tip.block_height;
let db_height = burnchain_tip.block_height;

// handle reorgs
let (sync_height, did_reorg) = Burnchain::sync_reorg(indexer)?;
Expand Down Expand Up @@ -1351,7 +1351,7 @@ impl Burnchain {
}
};

let burn_chain_tip = match burndb.get_canonical_chain_tip() {
let burnchain_tip = match burndb.get_canonical_chain_tip() {
Ok(tip) => tip,
Err(burnchain_error::MissingParentBlock) => {
// database is empty
Expand All @@ -1362,7 +1362,7 @@ impl Burnchain {
}
};

Ok(Some(burn_chain_tip))
Ok(Some(burnchain_tip))
}

/// Top-level burnchain sync.
Expand All @@ -1389,12 +1389,12 @@ impl Burnchain {
indexer.get_stacks_epochs(),
)?;

let burn_chain_tip = burnchain_db.get_canonical_chain_tip().map_err(|e| {
let burnchain_tip = burnchain_db.get_canonical_chain_tip().map_err(|e| {
error!("Failed to query burn chain tip from burn DB: {}", e);
e
})?;

let db_height = burn_chain_tip.block_height;
let db_height = burnchain_tip.block_height;

// handle reorgs (which also updates our best-known chain work and headers DB)
let (sync_height, did_reorg) = Burnchain::sync_reorg(indexer)?;
Expand Down Expand Up @@ -1487,7 +1487,7 @@ impl Burnchain {

if start_block == db_height && db_height == end_block {
// all caught up
return Ok(burn_chain_tip);
return Ok(burnchain_tip);
}

let total = sync_height - self.first_block_height;
Expand Down Expand Up @@ -1590,7 +1590,7 @@ impl Burnchain {
thread::Builder::new()
.name("burnchain-db".to_string())
.spawn(move || {
let mut last_processed = burn_chain_tip;
let mut last_processed = burnchain_tip;
while let Ok(Some(burnchain_block)) = db_recv.recv() {
debug!("Try recv next parsed block");

Expand Down

0 comments on commit 8cb8340

Please sign in to comment.