removed --diskdb option

This commit is contained in:
Svyatoslav Nikolsky 2016-11-16 09:58:26 +03:00
parent d6549849d5
commit fce53cdc8b
3 changed files with 3 additions and 13 deletions

View File

@ -29,9 +29,6 @@ args:
- printtoconsole: - printtoconsole:
long: printtoconsole long: printtoconsole
help: Send trace/debug info to console instead of debug.log file help: Send trace/debug info to console instead of debug.log file
- diskdb:
long: diskdb
help: Use disk storage instead of in-memory one
subcommands: subcommands:
- import: - import:
about: Import blocks from bitcoin core database about: Import blocks from bitcoin core database

View File

@ -8,12 +8,10 @@ pub struct Config {
pub connect: Option<net::SocketAddr>, pub connect: Option<net::SocketAddr>,
pub seednode: Option<String>, pub seednode: Option<String>,
pub print_to_console: bool, pub print_to_console: bool,
pub use_disk_database: bool,
} }
pub fn parse(matches: &clap::ArgMatches) -> Result<Config, String> { pub fn parse(matches: &clap::ArgMatches) -> Result<Config, String> {
let print_to_console = matches.is_present("printtoconsole"); let print_to_console = matches.is_present("printtoconsole");
let use_disk_database = matches.is_present("diskdb");
let magic = match (matches.is_present("testnet"), matches.is_present("regtest")) { let magic = match (matches.is_present("testnet"), matches.is_present("regtest")) {
(true, false) => Magic::Testnet, (true, false) => Magic::Testnet,
(false, true) => Magic::Regtest, (false, true) => Magic::Regtest,
@ -47,7 +45,6 @@ pub fn parse(matches: &clap::ArgMatches) -> Result<Config, String> {
port: port, port: port,
connect: connect, connect: connect,
seednode: seednode, seednode: seednode,
use_disk_database: use_disk_database,
}; };
Ok(config) Ok(config)

View File

@ -5,13 +5,9 @@ use chain::RepresentH256;
use {db, APP_INFO}; use {db, APP_INFO};
use config::Config; use config::Config;
pub fn open_db(cfg: &Config) -> Arc<db::Store> { pub fn open_db(_cfg: &Config) -> Arc<db::Store> {
if cfg.use_disk_database { let db_path = app_dir(AppDataType::UserData, &APP_INFO, "db").expect("Failed to get app dir");
let db_path = app_dir(AppDataType::UserData, &APP_INFO, "db").expect("Failed to get app dir"); Arc::new(db::Storage::new(db_path).expect("Failed to open database"))
Arc::new(db::Storage::new(db_path).expect("Failed to open database"))
} else {
Arc::new(db::TestStorage::default())
}
} }
pub fn node_table_path() -> PathBuf { pub fn node_table_path() -> PathBuf {