website: big update

This commit is contained in:
k
2024-11-11 15:20:31 +01:00
parent 12fe4c6ba5
commit 32fd4fa8ed
51 changed files with 2130 additions and 5020 deletions

View File

@@ -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");

View File

@@ -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))

View File

@@ -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();
}
}