mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-01 09:59:59 -07:00
website: big update
This commit is contained in:
@@ -18,7 +18,7 @@ use crate::{
|
||||
};
|
||||
|
||||
pub fn iter_blocks(
|
||||
config: &Config,
|
||||
config: &mut Config,
|
||||
rpc: &biter::bitcoincore_rpc::Client,
|
||||
approx_block_count: usize,
|
||||
exit: Exit,
|
||||
@@ -33,6 +33,7 @@ pub fn iter_blocks(
|
||||
|
||||
if config.first_defragment() {
|
||||
databases.defragment(&exit);
|
||||
config.disable_defragment();
|
||||
}
|
||||
|
||||
log("Imported databases");
|
||||
|
||||
@@ -8,7 +8,7 @@ fn main() -> color_eyre::Result<()> {
|
||||
|
||||
reset_logs();
|
||||
|
||||
let config = Config::import()?;
|
||||
let mut config = Config::import()?;
|
||||
|
||||
let rpc = create_rpc(&config).unwrap();
|
||||
|
||||
@@ -19,7 +19,7 @@ fn main() -> color_eyre::Result<()> {
|
||||
|
||||
log(&format!("{block_count} blocks found."));
|
||||
|
||||
iter_blocks(&config, &rpc, block_count, exit.clone())?;
|
||||
iter_blocks(&mut config, &rpc, block_count, exit.clone())?;
|
||||
|
||||
if let Some(delay) = config.delay {
|
||||
sleep(Duration::from_secs(delay))
|
||||
|
||||
@@ -171,4 +171,8 @@ impl Config {
|
||||
pub fn first_defragment(&self) -> bool {
|
||||
self.first_defragment.is_some_and(|b| b)
|
||||
}
|
||||
|
||||
pub fn disable_defragment(&mut self) {
|
||||
self.first_defragment.take();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user