Exit early if command line is invalid

This commit is contained in:
SChernykh 2024-02-04 00:19:37 +01:00
parent 8a2a9a99a9
commit a92ca028b1

View file

@ -62,6 +62,13 @@ p2pool::p2pool(int argc, char* argv[])
LOGINFO(1, log::LightCyan() << VERSION);
Params* p = new Params(argc, argv);
if (!p->valid()) {
LOGERR(1, "Invalid or missing command line. Try \"p2pool --help\".");
delete p;
throw std::exception();
}
m_params = p;
#ifdef WITH_UPNP