mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-29 00:59:58 -07:00
general: snapshot
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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::*;
|
||||
|
||||
Reference in New Issue
Block a user