Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | gArgs.AddArg( | ||||
"match corresponding -wallet option passed to bitcoind)"), | "match corresponding -wallet option passed to bitcoind)"), | ||||
false, OptionsCategory::OPTIONS); | false, OptionsCategory::OPTIONS); | ||||
// Hidden | // Hidden | ||||
gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); | gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); | ||||
gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); | gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); | ||||
} | } | ||||
/** libevent event log callback */ | |||||
static void libevent_log_cb(int severity, const char *msg) { | |||||
#ifndef EVENT_LOG_ERR // EVENT_LOG_ERR was added in 2.0.19; but before then | |||||
Fabien: Move comment above | |||||
// _EVENT_LOG_ERR existed. | |||||
#define EVENT_LOG_ERR _EVENT_LOG_ERR | |||||
#endif | |||||
// Ignore everything other than errors | |||||
if (severity >= EVENT_LOG_ERR) { | |||||
throw std::runtime_error(strprintf("libevent error: %s", msg)); | |||||
} | |||||
} | |||||
////////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////////// | ||||
// | // | ||||
// Start | // Start | ||||
// | // | ||||
// | // | ||||
// Exception thrown on connection error. This error is used to determine when | // Exception thrown on connection error. This error is used to determine when | ||||
// to wait if -rpcwait is given. | // to wait if -rpcwait is given. | ||||
▲ Show 20 Lines • Show All 484 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
int main(int argc, char *argv[]) { | int main(int argc, char *argv[]) { | ||||
SetupEnvironment(); | SetupEnvironment(); | ||||
if (!SetupNetworking()) { | if (!SetupNetworking()) { | ||||
fprintf(stderr, "Error: Initializing networking failed\n"); | fprintf(stderr, "Error: Initializing networking failed\n"); | ||||
return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
} | } | ||||
event_set_log_callback(&libevent_log_cb); | |||||
try { | try { | ||||
int ret = AppInitRPC(argc, argv); | int ret = AppInitRPC(argc, argv); | ||||
if (ret != CONTINUE_EXECUTION) { | if (ret != CONTINUE_EXECUTION) { | ||||
return ret; | return ret; | ||||
} | } | ||||
} catch (const std::exception &e) { | } catch (const std::exception &e) { | ||||
PrintExceptionContinue(&e, "AppInitRPC()"); | PrintExceptionContinue(&e, "AppInitRPC()"); | ||||
Show All 16 Lines |
Move comment above