adityapk00/zecwallet-light-cli

--nosync option makes cli crash

pacu opened this issue · 1 comments

pacu commented

If the options provided are not valid, the application should show an error indicating the problem instead of crashing

How to reproduce:

checkout commit

cargo build --release

./target/release/zecwallet-cli --server ${some_valid_server} --nosync

Thread 'main' panicked at 'Couldn't get network', [REDACTED]/zecwallet-light-cli/lib/src/lightclient/lightclient_config.rs:146:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Full stacktrace

thread 'main' panicked at 'Couldn't get network', /[redacted]/zecwallet-light-cli/lib/src/lightclient/lightclient_config.rs:146:13
stack backtrace:
   0:        0x101359cb4 - std::backtrace_rs::backtrace::libunwind::trace::h997b153ee4698449
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x101359cb4 - std::backtrace_rs::backtrace::trace_unsynchronized::h412a9f8cabb3a8b8
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x101359cb4 - std::sys_common::backtrace::_print_fmt::h1549a3ae59b7e9b9
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:66:5
   3:        0x101359cb4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h33d4544161da9cd0
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:45:22
   4:        0x10137643b - core::fmt::write::h22b56d6d417c492d
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/fmt/mod.rs:1196:17
   5:        0x101353848 - std::io::Write::write_fmt::h515a8855c6a84843
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/io/mod.rs:1654:15
   6:        0x10135b56d - std::sys_common::backtrace::_print::h5c83fc6fb38d6536
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:48:5
   7:        0x10135b56d - std::sys_common::backtrace::print::h4059261796096aec
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:35:9
   8:        0x10135b56d - std::panicking::default_hook::{{closure}}::hedda119dcd298b7b
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:295:22
   9:        0x10135b251 - std::panicking::default_hook::hc602c1312aa18d98
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:314:9
  10:        0x10135baee - std::panicking::rust_panic_with_hook::h3147bfce63989ccb
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:698:17
  11:        0x100d01fab - std::panicking::begin_panic::{{closure}}::h83d87265a9af3cf2
  12:        0x100cfed47 - std::sys_common::backtrace::__rust_end_short_backtrace::hdf58001fd56ee784
  13:        0x10137f59d - std::panicking::begin_panic::hf596284e9b739675
  14:        0x100adbf4e - zecwalletlitelib::lightclient::lightclient_config::LightClientConfig<P>::create::h031c93941cd809ca
  15:        0x100dfe74b - zecwallet_cli::startup::h1f0602e21d17eefc
  16:        0x1009d5e0d - zecwallet_cli::main::hd4985de08fb1d8e7
  17:        0x1009d19d6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0eb1966f1993f5a6
  18:        0x1009d19ec - std::rt::lang_start::{{closure}}::ha71997e589585322
  19:        0x10134dcbe - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h67b5113b31a14421
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/ops/function.rs:280:13
  20:        0x10134dcbe - std::panicking::try::do_call::h69576ef4c99409db
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492:40
  21:        0x10134dcbe - std::panicking::try::hc2612bc8e2fcc575
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456:19
  22:        0x10134dcbe - std::panic::catch_unwind::hcc32c0177abdc532
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137:14
  23:        0x10134dcbe - std::rt::lang_start_internal::{{closure}}::h07aa86e986d867fd
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128:48
  24:        0x10134dcbe - std::panicking::try::do_call::h776da42d0620be2b
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492:40
  25:        0x10134dcbe - std::panicking::try::hf7bc0ed3b7e9425b
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456:19
  26:        0x10134dcbe - std::panic::catch_unwind::hf72e7873323593b6
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137:14
  27:        0x10134dcbe - std::rt::lang_start_internal::h8e59f392f19ac690
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128:20
  28:        0x1009d6859 - _main

Thanks for reporting this, should be fixed now!