mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-17 13:24:49 -07:00
cli: config changes
This commit is contained in:
@@ -18,7 +18,7 @@ pub fn run() -> color_eyre::Result<()> {
|
||||
|
||||
let format = config.format();
|
||||
|
||||
let mut indexer = Indexer::forced_import(&config.outputsdir())?;
|
||||
let mut indexer = Indexer::forced_import(&config.brkdir())?;
|
||||
|
||||
let wait_for_synced_node = |rpc_client: &bitcoincore_rpc::Client| -> color_eyre::Result<()> {
|
||||
let is_synced = || -> color_eyre::Result<bool> {
|
||||
@@ -37,7 +37,7 @@ pub fn run() -> color_eyre::Result<()> {
|
||||
};
|
||||
|
||||
let mut computer = Computer::forced_import(
|
||||
&config.outputsdir(),
|
||||
&config.brkdir(),
|
||||
&indexer,
|
||||
config.computation(),
|
||||
config.fetcher(),
|
||||
|
||||
@@ -7,6 +7,7 @@ use std::{
|
||||
|
||||
use brk_core::{Error, Result};
|
||||
use libc::off_t;
|
||||
use log::info;
|
||||
use memmap2::{MmapMut, MmapOptions};
|
||||
use parking_lot::{RwLock, RwLockReadGuard};
|
||||
|
||||
@@ -461,10 +462,10 @@ impl File {
|
||||
.try_for_each(|(&start, &hole)| -> Result<()> {
|
||||
assert!(start % PAGE_SIZE == 0);
|
||||
assert!(hole % PAGE_SIZE == 0);
|
||||
let has_old_data = (((start / PAGE_SIZE) as usize)
|
||||
..((start + hole) / PAGE_SIZE) as usize)
|
||||
.any(|i| mmap[i * PAGE_SIZE as usize] != 0);
|
||||
let has_old_data =
|
||||
mmap[start as usize] != 0 || mmap[(start + hole - PAGE_SIZE) as usize] != 0;
|
||||
if has_old_data {
|
||||
info!("Punching a hole of {hole} bytes at {start}...");
|
||||
Self::punch_hole_(file, start, hole)
|
||||
} else {
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user