MCPcopy Create free account
hub / github.com/ElementsProject/elements / main

Function main

src/bitcoin-cli.cpp:1224–1257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222 std::tie(argc, argv) = winArgs.get();
1223#else
1224int main(int argc, char* argv[])
1225{
1226#endif
1227 SetupEnvironment();
1228 if (!SetupNetworking()) {
1229 tfm::format(std::cerr, "Error: Initializing networking failed\n");
1230 return EXIT_FAILURE;
1231 }
1232 event_set_log_callback(&libevent_log_cb);
1233
1234 try {
1235 int ret = AppInitRPC(argc, argv);
1236 if (ret != CONTINUE_EXECUTION)
1237 return ret;
1238 }
1239 catch (const std::exception& e) {
1240 PrintExceptionContinue(&e, "AppInitRPC()");
1241 return EXIT_FAILURE;
1242 } catch (...) {
1243 PrintExceptionContinue(nullptr, "AppInitRPC()");
1244 return EXIT_FAILURE;
1245 }
1246
1247 int ret = EXIT_FAILURE;
1248 try {
1249 ret = CommandLineRPC(argc, argv);
1250 }
1251 catch (const std::exception& e) {
1252 PrintExceptionContinue(&e, "CommandLineRPC()");
1253 } catch (...) {
1254 PrintExceptionContinue(nullptr, "CommandLineRPC()");
1255 }
1256 return ret;
1257}

Callers

nothing calls this directly

Calls 6

SetupEnvironmentFunction · 0.85
SetupNetworkingFunction · 0.85
AppInitRPCFunction · 0.85
PrintExceptionContinueFunction · 0.85
CommandLineRPCFunction · 0.85
formatFunction · 0.70

Tested by

no test coverage detected