From bbad2def581d178620b3c75983c64eb8070b541b Mon Sep 17 00:00:00 2001 From: max143672 Date: Thu, 28 Sep 2023 18:40:46 +0400 Subject: [PATCH] use constants defining db file limits --- kaspad/src/daemon.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kaspad/src/daemon.rs b/kaspad/src/daemon.rs index 33a2633b8..a0dc122f1 100644 --- a/kaspad/src/daemon.rs +++ b/kaspad/src/daemon.rs @@ -195,9 +195,8 @@ do you confirm? (answer y/n or pass --yes to the Kaspad command line to confirm // DB used for addresses store and for multi-consensus management let mut meta_db = kaspa_database::prelude::ConnBuilder::default() - .with_files_limit(META_DB_FILE_LIMIT) .with_db_path(meta_db_dir.clone()) - .with_files_limit(5.max(fd_total_budget * 5 / 100)) + .with_files_limit(META_DB_FILE_LIMIT.max(fd_total_budget * 5 / 100)) .build() .unwrap(); @@ -221,9 +220,8 @@ do you confirm? (answer y/n or pass --yes to the Kaspad command line to confirm // Reopen the DB meta_db = kaspa_database::prelude::ConnBuilder::default() - .with_files_limit(META_DB_FILE_LIMIT) .with_db_path(meta_db_dir) - .with_files_limit(5.max(fd_total_budget * 5 / 100)) + .with_files_limit(META_DB_FILE_LIMIT.max(fd_total_budget * 5 / 100)) .build() .unwrap(); } @@ -280,9 +278,8 @@ do you confirm? (answer y/n or pass --yes to the Kaspad command line to confirm let index_service: Option> = if args.utxoindex { // Use only a single thread for none-consensus databases let utxoindex_db = kaspa_database::prelude::ConnBuilder::default() - .with_files_limit(UTXO_INDEX_DB_FILE_LIMIT) .with_db_path(utxoindex_db_dir) - .with_files_limit(10.max(fd_total_budget * 15 / 100)) + .with_files_limit(UTXO_INDEX_DB_FILE_LIMIT.max(fd_total_budget * 15 / 100)) .build() .unwrap(); let utxoindex = UtxoIndexProxy::new(UtxoIndex::new(consensus_manager.clone(), utxoindex_db).unwrap());