Skip to content

Commit

Permalink
Disable redb checksums (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Aug 16, 2022
1 parent 3bdc256 commit 5cce0a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use {
super::*,
bitcoincore_rpc::{Auth, Client, RpcApi},
rayon::iter::{IntoParallelRefIterator, ParallelIterator},
redb::WriteStrategy,
};

const HEIGHT_TO_HASH: TableDefinition<u64, [u8]> = TableDefinition::new("HEIGHT_TO_HASH");
Expand All @@ -21,7 +22,9 @@ impl Index {
let database = match unsafe { redb::Database::open("index.redb") } {
Ok(database) => database,
Err(redb::Error::Io(error)) if error.kind() == io::ErrorKind::NotFound => unsafe {
redb::Database::create("index.redb", options.max_index_size.0)?
Database::builder()
.set_write_strategy(WriteStrategy::Throughput)
.create("index.redb", options.max_index_size.0)?
},
Err(error) => return Err(error.into()),
};
Expand Down

0 comments on commit 5cce0a9

Please sign in to comment.