Allow empty magic
This commit is contained in:
parent
c6b8be94b7
commit
181785b5c1
@ -141,6 +141,7 @@ impl Config {
|
||||
.arg(
|
||||
Arg::with_name("magic")
|
||||
.long("magic")
|
||||
.default_value("")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
@ -336,6 +337,7 @@ impl Config {
|
||||
let network_type = Network::from(network_name);
|
||||
let magic: Option<u32> = m
|
||||
.value_of("magic")
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(|s| u32::from_str_radix(s, 16).expect("invalid network magic"));
|
||||
let db_dir = Path::new(m.value_of("db_dir").unwrap_or("./db"));
|
||||
let db_path = db_dir.join(network_name);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user