Use a constant for DB path

This commit is contained in:
Roman Zeyde 2018-04-13 22:58:54 +03:00
parent 5e48e1e1dc
commit 7d26232b53
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

View File

@ -23,12 +23,14 @@ fn setup_logging() {
]).unwrap();
}
const DB_PATH: &str = "db/mainnet";
fn run_server() {
let waiter = waiter::Waiter::new("tcp://localhost:28332");
let daemon = daemon::Daemon::new("http://localhost:8332");
{
let mut store = store::Store::open(
"db/mainnet",
DB_PATH,
store::StoreOptions {
auto_compact: false,
},
@ -37,7 +39,7 @@ fn run_server() {
store.compact_if_needed();
}
let mut store = store::Store::open("db/mainnet", store::StoreOptions { auto_compact: true });
let mut store = store::Store::open(DB_PATH, store::StoreOptions { auto_compact: true });
loop {
if store.read_header(&waiter.wait()).is_some() {
continue;