mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-28 11:46:07 +08:00
use const instead of magic number
This commit is contained in:
@@ -56,6 +56,12 @@ use stacks::monitoring::{increment_btc_blocks_received_counter, increment_btc_op
|
||||
#[cfg(test)]
|
||||
use stacks::chainstate::burn::Opcodes;
|
||||
|
||||
/// The number of bitcoin blocks that can have
|
||||
/// passed since the UTXO cache was last refreshed before
|
||||
/// the cache is force-reset.
|
||||
const UTXO_CACHE_STALENESS_LIMIT: u64 = 6;
|
||||
const DUST_UTXO_LIMIT: u64 = 5500;
|
||||
|
||||
pub struct BitcoinRegtestController {
|
||||
config: Config,
|
||||
indexer_config: BitcoinIndexerConfig,
|
||||
@@ -179,8 +185,6 @@ impl LeaderBlockCommitFees {
|
||||
}
|
||||
}
|
||||
|
||||
const DUST_UTXO_LIMIT: u64 = 5500;
|
||||
|
||||
impl BitcoinRegtestController {
|
||||
pub fn new(config: Config, coordinator_channel: Option<CoordinatorChannels>) -> Self {
|
||||
BitcoinRegtestController::with_burnchain(config, coordinator_channel, None)
|
||||
@@ -1016,7 +1020,7 @@ impl BitcoinRegtestController {
|
||||
let mut traversal_depth = 0;
|
||||
let mut burn_chain_tip = burnchain_db.get_canonical_chain_tip().ok()?;
|
||||
let mut found_last_mined_at = false;
|
||||
while traversal_depth < 6 {
|
||||
while traversal_depth < UTXO_CACHE_STALENESS_LIMIT {
|
||||
if &burn_chain_tip.block_hash == &ongoing_op.utxos.bhh {
|
||||
found_last_mined_at = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user