general: snapshot

This commit is contained in:
k
2024-07-20 23:13:41 +02:00
parent d8a5b4a2e6
commit a145b35ad1
100 changed files with 5402 additions and 2967 deletions

View File

@@ -4,6 +4,7 @@ use color_eyre::eyre::eyre;
use serde_json::Value;
use crate::{
structs::Height,
utils::{log, log_output, retry},
Config,
};
@@ -71,10 +72,10 @@ impl BitcoinDaemon {
}
}
pub fn wait_for_new_block(&self, last_block_height: usize) {
pub fn wait_for_new_block(&self, last_block_height: Height) {
log("Waiting for new block...");
while self.get_blockchain_info().headers as usize == last_block_height {
while last_block_height == self.get_blockchain_info().headers {
sleep(Duration::from_secs(5))
}
}

View File

@@ -1,5 +0,0 @@
use super::NUMBER_OF_UNSAFE_BLOCKS;
pub fn check_if_height_safe(height: usize, block_count: usize) -> bool {
height < block_count - NUMBER_OF_UNSAFE_BLOCKS
}

View File

@@ -2,10 +2,8 @@ mod addresses;
mod consts;
mod daemon;
mod db;
mod height;
pub use addresses::*;
pub use consts::*;
pub use daemon::*;
pub use db::*;
pub use height::*;